MentorNode
Start free
Geo, Maps & MarketplacesHarddesign-food-delivery

Design a Food Delivery Platform (DoorDash)

Design a three-sided marketplace where an order's success depends on a restaurant, a courier, and a customer staying in sync through a multi-stage, failure-prone workflow.

Three-Sided MarketplaceBatched DispatchETA PredictionSaga Orchestration
Traffic & Capacity Estimates:

2M orders/day · 500k restaurants · 200k active couriers · 45-minute median delivery

Functional Requirements

  • •Show a customer nearby open restaurants with accurate menus, prices, and delivery estimates.
  • •Orchestrate the order through payment, restaurant acceptance, preparation, courier assignment, pickup, and delivery.
  • •Assign and batch couriers considering location, prep time, and multi-order routes.
  • •Handle cancellations, refunds, and substitutions at any stage of the workflow.

Non-Functional Requirements

  • •Courier assignment within 60 seconds of the restaurant accepting.
  • •Order state must be consistent across three apps at all times — no phantom or duplicate orders.
  • •Peak dinner-rush load is roughly 10x the daily mean and must not degrade assignment quality to uselessness.

Back-of-the-Envelope Math

  • 2M orders/day with a 4-hour dinner peak carrying ~50% of volume = ~70 orders/second at peak.
  • Live tracking: 200k couriers * 1 update/3s = ~67k location writes/second.

Key Architectural Trade-offs

  • The order is a long-running saga across payment, restaurant, and logistics services — every step needs a compensating action, and 'cancelled after pickup' is a business decision encoded in code.
  • Batching multiple orders per courier cuts delivery cost and raises per-customer delivery time — the objective function is explicitly a trade, not an optimum.
  • Menu and availability data is read enormously and written rarely: aggressive caching is obvious, and a stale sold-out item is a customer-facing failure.

Click or drag a component onto the canvas, then connect the handles to draw the data flow.

3 nodes · 2 edges

Components · 35

Client & Edge4
Compute & Gateway7
Storage & Caching11
Messaging & Streaming6
Coordination & Ops5
Intelligence2
Canvas overview