DoorDash splits coordination and compute: 10x and 99.99%

Architecture New By 3 min read

DoorDash rebuilt dispatch by splitting coordination from compute. 10x throughput and 99.99% at peak. What can we copy without blowing our SLAs?

DoorDash went back to the whiteboard and rebuilt its dispatch engine by cleanly separating coordination from computation. With that split, plus hierarchical decomposition and gRPC payload sharding, they report 10x throughput and 99.99%+ availability at peak. They also run local ONNX inference and use multi‑agent reinforcement learning to tune objectives in real time.

What happened

The previous engine was a big block: business rules, global state and heavy algorithms tangled together. Under peak load, near‑quadratic complexity and reality moving faster than CPUs pushed them into emergency heuristics.

The new design separates into two independently scalable tiers:

  • Stateful coordinator: orchestrates dispatch lifecycle, maintains global logistics state, validates rules.
  • Stateless workers: run optimization, routing heuristics and model inference.

To cut network noise, the coordinator shards and sends localized slices of data to each worker over gRPC instead of blasting the whole world to everyone. Complexity is addressed by partitioning into geographic clusters and trajectories; workers solve smaller pieces in parallel and results are reconciled.

Migration used shadow testing: duplicate traffic, compare outputs, measure match quality, timings and resilience; then controlled switchbacks and fallbacks. Reported outcomes: 10x throughput; over 99.96% of runs finish within 20 s; on Super Bowl Sunday they held 99.99%+ availability with a 10% week‑over‑week peak increase.

They also split model serving in two layers: latency‑sensitive inference runs inside workers with ONNX Runtime; heavier evaluations go to remote isolated model clusters, away from the state‑management path.

Why it matters

The lesson isn’t just “add more boxes.” It’s designing for the speed of reality: isolate orchestration from numeric muscle, minimize fan‑out, and parallelize where it hurts. Keep the state path clean from heavy ML; the ML that stays in the hot path must add value in milliseconds. On top of that, multi‑agent reinforcement adjusts weights using local signals (merchant congestion, courier utilization) to balance speed and batching without breaking the marketplace.

Concrete ideas I’d apply

  • Separation of concerns: a stateful brain deciding what, many stateless arms computing how. Each scales and fails differently.
  • Payload sharding: ship only what each job needs. Fewer bytes, less mental lock‑contention for workers.
  • Hierarchical decomposition: slice by geography/affinity, solve local, reconcile global. Hitting “good enough” fast wins.
  • Deterministic caching (my go‑to): cache by snapshot_id or data window, keep functions pure with explicit inputs and idempotency. You can repeat, compare and degrade without surprises.
  • Graceful degradation by time budget: at X ms return the best partial plan; past deadline, fall back to a simple heuristic. A good plan now beats a perfect plan never.
  • Two‑tier ML: L1 on‑box with lightweight runtimes for features that close decisions; L2 remote for heavy stuff, off the critical path.
  • Roll out with a net: shadow testing, switchbacks and quality KPIs (not just latency). If matching drops, roll back.
  • Backpressure and circuit breakers at the coordinator: when the system gets punchy, protect state and sacrifice compute.

Risks and trade‑offs

  • The coordinator becomes critical: real HA, consensus and sturdy storage or you just built a hidden monolith.
  • Bad partitioning hurts fairness: poorly defined clusters bias assignments. Track drift and adjust boundaries dynamically.
  • Deterministic caches with aggressive TTLs or stale snapshots can harm UX. Observability first.

My take: split coordination from compute, then decompose and cache deterministically to buy throughput and availability without burning your SLA. Next, be picky about which ML lives in the hot path. And measure quality, not just timings.

Which degradation trick saved you more often: time budgets, precomputed top‑K, or trusty old heuristics?

PS: if your “coordinator” also crunches routes, trains models and brews coffee, it’s not a coordinator; it’s a monolith with a new haircut.

Related posts

More categories