Food delivery platform
An event-driven delivery backend: orders absorb spikes through a leveling queue, and driver dispatch runs as a scatter-gather auction over geo-partitioned cells.
What this design does
Delivery platforms live on two nasty curves: lunch-rush spikes and the physics of finding a nearby driver fast. This design absorbs the spike with queue-based load leveling (the kitchen doesn't care about your p99), then dispatches by auction — offers scatter to candidate drivers in the order's geo cell, and the first acceptance wins the gather. Geo-partitioning keeps every dispatch decision local: a busy downtown cell can't slow the suburbs.
The patterns it composes
- Queue-based load leveling — the noon spike queues; kitchens and dispatch consume at their own pace
- Scatter-gather (auction) — offers fan out to nearby drivers; first accept wins, rest are cancelled
- Geo-partitioning — drivers and dispatch state shard by city cell — decisions stay local
- Event notification — restaurants and customers learn of state changes via events, not polling
- Rate limiting at the edge — checkout stays fair when a promo goes viral
Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.