Course map

Project 15

Food delivery platform

Order coordination, dispatch

Start after Part 8 + topic 210

Key topics 122, 139, 210

Architecture Services

Brief

A three-sided marketplace: customers order from restaurants, restaurants accept and prepare, couriers deliver — one long-running distributed workflow across independent parties.

Targets

100k orders/hour at mealtime peaks · order placement p99 < 1 s · every order reaches a terminal state (no stuck orders) · restaurant tablets tolerate going offline.

Must cover

  • Geospatial lookup for courier dispatch (→ 210).
  • Order compensation — every forward step has a designed undo (→ 139).
  • Restaurant acceptance — the accept/reject/timeout flow after payment authorization (P).
  • Courier reassignment — re-dispatch when a courier cancels or goes dark (P).

Design challenges

  1. The order saga in full (→ 139, 122): payment authorized → restaurant accepts → courier assigned → picked up → delivered, with compensations at every stage (restaurant rejects after payment; no courier found; customer cancels mid-preparation). Orchestration vs. choreography — chosen and defended.
  2. Restaurant availability: menu and hours staleness vs. rejection rate (→ 129).
  3. Courier dispatch (→ 210): batching nearby orders, offer timeouts, re-dispatch — Project 14's matching with preparation-time prediction as an input.
  4. Stuck-order detection: timers and watchdogs on every non-terminal state (→ 121; → 202 — ahead, Part 12).
  5. Three parties, three views: per-party BFFs over shared order truth (→ 148).
  6. Mealtime spikes: pre-scaling vs. autoscaling lag; queues where latency allows (→ 95, 110).

Out of scope

Pricing and promotions engine; courier earnings and payouts (→ Projects 8–9).

Search the guide