How Shopify Sharded Rails
summary
Shopify shards a once-single Rails DB in 2013 to handle ~150k requests per minute with peaks near 400k and $1.6B GMV and ~88k paying shops, doubled the number of databases and builds a block-based connection switcher plus a charted-model concern. Primary keys use a MySQL auto-increment trick instead of a separate ID service. Verifiers catch cross-chart queries, a locking migrator copies shops live, and production sees 80ms average response time through CyberMonday.
AI-written summary · about
chapters (10)
- 0:00Start
- 2:20Cons of sharding
- 6:09Sharding Shopify
- 8:34Denormalize
- 9:33Primary keys
- 11:59Connection switching
- 15:02Rebalancing
- 17:57What about JOINS
- 19:33How long did it take?
- 20:58OMG Cybermonday
related talks
41mHow Shopify Scales Rails
40mHow Shopify Scales Rails
37mScaling Rails for Black Friday and Cyber Monday
17mHow We Deploy Shopify
31mA Rails performance guidebook: from 0 to 1B requests/day
56mScaling Rails API to Write-Heavy Traffic
32mRails Security at Scale
29mMigrating Shopify’s Core Rails Monolith to Trilogy
