The chapters — one page each
- 01The brief, and one request end to endWho uses Dabba, how much, and at what peak; then where the time goes when a customer opens the app at 8 pm, and how an optional service can take the home screen down.
- 02Designing the APIThe contract for placing an order, written so that a lost response and a second tap still produce one order and one charge, and so that months-old app versions keep working.
- 03Load balancing, gateways and discoveryWhy Dabba runs thirty servers where twenty would do, how the balancer picks one, what the gateway checks first, and how a health check can remove a healthy fleet.
- 04Scaling readsThe menu is read sixteen times for every order. Caching it means deciding, part by part, how stale each piece may be, and defending against races, stampedes and cold starts.
- 05The edge: CDNs and static deliveryDish photos and public menus served from near the customer, with URLs that never need purging and headers that never show one customer another’s orders.
- 06Where the data actually livesOrders, menus, rider locations and photos behave differently. We open the two common storage engines and give each data set the home that fits it.
- 07Data modelling across paradigmsWhich facts an order copies and freezes, which it references, why a history screen made 141 queries, and what the same data looks like in a key-value store.
- 08Getting writes rightForty customers tap Place order for the last twelve thalis. What the database guarantees, where its guarantees stop, and how to stay correct when payment happens somewhere else.
- 09Sharding and partitioningDabba’s orders outgrow one database. Choosing the shard key decides which queries stay on one machine and which must ask them all.
- 10Streams and the logPlacing an order owes work to six other systems. An append-only log lets the order service record it once and lets each reader catch up in its own time.
- 11Derived data: search, analytics and change captureSearch, analytics and per-customer history are copies of the truth. Build them from the commit log, promise how fresh they are, and make sure they can be rebuilt.
- 12Counting at scale: probabilistic structuresUnique menu viewers and trending dishes, live and merged across servers: when a small, calculable error buys kilobytes instead of gigabytes, and when it does not.
- 13Geospatial indexing and proximityRestaurants that deliver here, and the nearest free rider right now: two nearness questions that need cells, neighbours and very different storage.
- 14Identity, time and unique IDsDesigning Dabba’s order id: unique without coordination, sorted by time, able to find its own shard, and careful about what it reveals.
- 15Files, media and blob storageTen million dish photos: the database keeps the facts, object storage keeps the bytes, and the upload never passes through our servers.
- 16Realtime: live location and pushThe rider on the map and the tablet that must ring: when polling is enough, when to hold a connection open, and what open connections cost.
- 17Background work: queues, schedulers and cron at scaleWhen the customer stops waiting, the work still has to happen exactly once in effect, on time and visibly: queues, retries, poison messages and scheduled jobs for Dabba’s notifications, refunds and payouts.
- 18Rate limiting and abuse protectionAn OTP endpoint, a script and an SMS bill: deciding how much each caller may ask for, keying limits on what attackers cannot vary, and counting across many machines.
- 19Identity, authorisation and the security basicsCustomers, restaurants and riders read the same order row. Who is calling, which slice of it they may see and when, and how to trust a payment webhook.
- 20Designing for failureThe payment provider slows down at dinner peak and the menus stop loading. Timeouts, retries, breakers, bulkheads and load shedding, worked through with Little’s law.
- 21Multi-region and disaster recoveryWhat an hour without Dabba costs, what a second region costs, why cities make active-active practical, and the drills that show whether failover works.
- 22Shipping safely: deploys, flags and migrationsMost incidents follow a change. Canaries sized from the signal, flags, schema migrations that keep old and new code working, and rollbacks that are tested.
- 23A worked design, end to endAssigning a rider to an order, taken from invariants and numbers through races and failure modes to a table of decisions another engineer can challenge.
- 24The problem atlas: classic designs decomposedFamiliar design problems placed by their invariant, their dominant ratio and their scarce resource, and mapped to the chapters that make each one hard.