Series · 14 parts · about 139 min
Platform at Scale
A fourteen-part series on how a multi-product ordering platform grew on GCP: what broke at peak, what each fix cost, and the trade-off behind it. From one monolith on a Saturday night to services, queues, availability, data growth, fair tenancy, safe deploys, a developer platform and the edge.
System designScalingGCPReliabilityPlatform engineering
Start with Part 1 All parts, in reading order
- 01Saturday Night, Every Channel at OnceDine-in, app, web and delivery partners all peak on the same Saturday evening. How an ordering monolith on GCP survived it: a bigger box, indexes from real queries, Redis, then scale-out, in that order.15 min
- 02The Menu Is the StorefrontCaching a restaurant menu is easy. Knowing the exact moment the cached menu stops being true is the hard part: versioned keys, sold-out status kept apart, the 11:00 breakfast-to-lunch switch and checking the truth at checkout.13 min
- 03When the Replica Is a Few Seconds BehindRead replicas take dashboards and reports off the primary, and make your system a little bit wrong. Primary by default, replica reads opted in per endpoint, lag measured honestly, and a plan for when replicas fall behind.9 min
- 04Two Taps, One ChargeRetries, double taps and resent provider notices turned festive peaks into double charges. One key per payment intent, explicit payment states, short locks, idempotent provider calls and reconciliation as the safety net.11 min
- 05One Service Down, Everything DownA slow loyalty lookup stopped orders on every channel. How we split an ordering monolith by blast radius: a small core of four services, products on top, separate databases and pools, moved one piece at a time.10 min
- 06You Can't Fix What You Can't SeeAfter the split, one paid order vanished between five services and took hours to find. Order IDs, trace IDs and spans, one definition of success, burn-rate alerts with owners, and monitoring that never slows checkout.10 min
- 07Click Events and the Cloud Run BillClick events for recommendation models, kitchen tickets and loyalty points all ran inside the order request. Pub/Sub, Cloud Run consumers, an outbox for business events, and the right delivery guarantee for each kind of event.10 min
- 08Partners That Take One Order at a TimeSome partner systems accept one order at a time and reject the rest. An outbox, RabbitMQ with a queue per partner and a lane per outlet, limits set per partner, asking before resending, and reconciliation with every partner.9 min
- 09The Region That Wasn't ThereThe database failed over perfectly, and the platform still had a bad night because Redis and RabbitMQ lived in one zone. Every stateful piece across zones first, restore drills, then a warm standby region for the data.8 min
- 10The Table That Grew ForeverPeak load is a spike; data growth is a slope. Archiving on a policy, monthly partitions and the MySQL unique-key catch, a warehouse for old data, and sharding only when writes hit a measured ceiling.7 min
- 11One Tenant Can't Sink the ShipOne merchant's promotion slowed every other merchant. Quotas sized from each tenant's own peak, a fair share of partner consumers and database connections, a shedding order decided in advance, and alerts on each tenant's rate of change.7 min
- 12Deploying on a SaturdayA change freeze avoids deploying; it does not make deploying safe. Feature flags, gradual rollouts judged by what diners feel, two-step database changes, rehearsed rollbacks and error budgets that decide when to stop.7 min
- 13The Pipeline Was Not a PlatformCI/CD worked perfectly, and a new team still took a week to ship. Infrastructure as code, a developer portal, golden paths that inherit every earlier lesson, and policy as code that makes the safe path the easy path.10 min
- 14The Edge Is Part of the PlatformA changed outbound IP, a missing CORS header and a staging Owner account, all in one night. One front door, one API gateway, a WAF, one identity per service, fixed outbound addresses, and a golden path that generates all of it.13 min