Slides for a talk given at Node on The Road found here: https://www.joyent.com/developers/videos/node-js-on-the-road-nyc-craig-spaeth-brennan-moore. These outline Artsy's (artsy.net) transition from a monolithic Ruby on Rails stack to a distributed system with Node.js powered front ends.
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Artsy at Node on the Road
1. Craig Spaeth & Brennan Moore
Artsy Web Engineering
@craigspaeth & @zamiang
2. WHY WE MIGRATED TO NODE
RUBY ON RAILS
RUBY
ON
RAILS
API
BACKBONE UI
IOS PROTOTYPE
BACKBONE UI
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
V
EB
BRO
KE
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
V
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
V
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
T
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
M
O
BIL
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
M
O
BILE
W
EB
BRO
KEN
RUBY
ON
RAILS
ANALYTICS
EMAL
GENERATORS
API
ADMINPANELCODE
IOS APP CMS
3. KEN
EB
BRO
KEN
PROBLEMS WITH BACKBONE + RAILS STACK
• Slow JS testing
• Ruby/JS—lack of re-use
• Hard to understand
hybrid stack
• Huge single page app
• Bloated & slow assets
8. MIGRATING USERS PAGE BY PAGE UNTIL NODE WAS IN FRONT
NEW
NODE APP
LEGACY
RAILS APP
HAPROXY
/browse
/artist/:id
/tag/:id
NEW
NODE APP
HAPROXY
+ LEGACY
RAILS APP
NODE-HTTP-PROXY
10. MEET EZEL: ARTSY’S JS APP BOILERPLATE
• Philosophy: Modularity, Flexibility, Isomorphic
• Apps: Express sub-apps mounted
• Components: Modules of UI grouping CSS,
templates, and JS together
• Simple re-use, small asset package size,
test everything in Node
• Ezeljs.com
11. PAIN POINTS IN TRANSITION
• Syncing auth
• Tracking memory usage
& leaks
• npmjs.org stability
• Integration testing a
distributed architecture
Patrick Lichty
A Failure in The Interwebz, 2013
12. WINS
Community
• npm for server & client
Productivity
• 1,000+ tests under 5 mins.
• 5 min. deploys, ~5 times a day
Performance
• Page load speed cut in half
• 40+ Rails servers to 2 Node servers
• SEO—Shared rendering server/client
Patrick Lichty
A Failure in The Interwebz, 2013
Loving Parent
Success Baby, circa. 2007