Scaling Shopify's Multi-Tenant Architecture across Multiple Datacenters
summary
Shopify moves from a single big MySQL to per-shop database sharding, splitting ~275,000 merchants so each shop’s rows live in one primary with cross-datacenter replicas, cutting DB pressure and surviving 1M RPM flash-sale patterns. A custom Sorting Hat (OpenResty Lua) in nginx routes domains to “parts,” enabling BGP anycast + ECMP at the edge and a direct fiber tunnel for bgp propagation delays. Automated failover script reduces outages to ~5 minutes with storefront browseable and checkout paused for ~2 minutes; floating capacity handles hotspots.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:30About Shopify
- 9:15The Spectrum
- 9:49Conventional Rails
- 10:34Partitioning
- 12:20Why do we want to do this
- 12:57How this looks
- 13:50How failure was used
- 14:21The advantage of one script
- 15:29Stateless servers
- 17:07Parting
- 18:50Sorting Hat
- 20:34Isolation vs Utilization
- 21:51Floating Capacity
- 22:29Next Chapter
- 22:56Datacenter Failure
- 25:51Multiple Load Balancers
- 32:04Summary
- 33:12EngineX
- 34:17Conclusion
related talks
23mStanding On the Shoulders of Giants...
39mZero-Downtime Rebalancing and Data Migration of a Mature Multi-Shard Platform
22mReliable Data Replication
20mReindexing in record time (...)
33mBuilding an Elastic, Resilient Data Layer to Power New Retail Experiences
38mMigrating Shopify’s Core Rails Monolith to Trilogy
52mTaking Storage for a Ride
46mEdgestore Multi-tenancy & Isolation
