Order-dispatch queue
Your task
Design the order-dispatch queue for a food-delivery platform that routes ~50k new orders/min at peak to a fleet of courier-assignment workers. Each restaurant's orders must be processed in the sequence they were placed, assignment must complete within 2 seconds p95, and a worker crash must not silently drop an order. Walk through the queueing topology, how you preserve per-restaurant ordering without serializing the whole system, and how you handle a poison order that repeatedly fails assignment.
It covers
- Dead letter
- Ordering
- Backpressure