Subscribe free
Morning Merge Architecture · Thursday, November 26, 20264 min read

DoorDash splits dispatch; AWS will run Envoy for you

Also: Lambda orchestrates MicroVMs, what server.close() misses, GitHub drops CSS-in-JS

Most of today is about giving state one owner and making everything else disposable. DoorDash did that to its dispatch engine, and its write-up is the one to read first.

The main thing

Isometric blueprint drawing of a fuchsia coordinator tower handing map tiles down to a row of worker desks.

DoorDash split its dispatch engine into one stateful coordinator and a pool of stateless workers. InfoQ reports that the rebuild of DoorDash's real-time dispatch platform delivers 10 times the throughput, with more than 99.96% of runs finishing within 20 seconds.

The old engine was a monolith that held business logic, logistics state and routing math in one place. The algorithms were roughly quadratic, and at peak, demand approached four times what the system could process. So it fell back on heuristics and sometimes assigned deliveries on incomplete information.

The interesting decision is what DoorDash didn't do. Adding machines doesn't fix a quadratic problem with a deadline; as the team put it, the bottleneck was "the speed of reality." Instead it split the work by kind.

A stateful coordinator owns dispatch lifecycles, the global logistics state and the business rules. Stateless compute workers do the optimization, routing heuristics and model inference. The coordinator never broadcasts the whole world: it shards the payload over gRPC, so each worker gets only the slice it needs.

The quadratic part is handled by decomposition. The coordinator partitions data into geographic clusters and delivery trajectories, workers solve the smaller problems in parallel, and a reconciliation layer stitches the results back together.

Inference follows the same split. Latency-sensitive models run inside the workers on ONNX Runtime, and heavier evaluations go to separate model-serving clusters, away from the coordinator's state path.

The rollout is the part worth copying. DoorDash duplicated production requests into the new platform in shadow mode while the legacy engine kept making the real assignments, then compared matching quality, delivery times and behavior under load.

Only after parity did it move to switchback experiments with fallbacks. DoorDash says the platform held more than 99.99% availability on Super Bowl Sunday, with peak volume up 10% week over week.

What to do: if a hot service mixes state ownership with heavy computation, draw that line first. Design the reconciliation step carefully, because that's where partitioned answers can disagree.

Handing off the hard parts

Isometric blueprint drawing of a crane lowering a fuchsia gatehouse into its own walled enclosure beside a row of houses.

AWS made ELB for Envoy generally available. It's a new load balancer type that runs open-source Envoy proxies on dedicated EC2 instances with Nitro hardware isolation, and AWS patches Envoy and the OS itself. You bring existing Envoy configurations, extensions and control planes, with WebAssembly, Lua or external processing for custom logic.

Envoy Gateway users can install a remote infrastructure provider and move proxies over without rewriting Gateway API resources. It's in 14 Regions. The announcement points to the pricing page rather than quoting prices, so price your fleet before you hand it over.

Lambda durable functions can now orchestrate MicroVMs, in developer preview. A durable function runs tasks in isolated MicroVMs, or in a session where tasks share files and memory, and checkpoints and retries each one. AWS says to keep it out of production for now. The shape is DoorDash's split again: a durable control loop outside, a disposable sandbox inside.

Vercel's experimental Board coordinates agents with leased tasks. A worker claims a task for a lease of up to five minutes and must renew it, or the task returns to the queue. A second claim fails with task_claimed. That's a job queue with sensible semantics.

One catch from Vercel's docs: Board grants don't apply on Slack, GitHub or Linear, so a private Slack channel synced into an open board channel is readable by the whole Vercel team.

Shutting down and copying out

Isometric blueprint drawing of a fuchsia shop door swinging shut while parcels keep arriving on a conveyor belt.

A measured look at what server.close() misses in Node.js. The author sent SIGTERM to servers under 200 requests per second of load. server.close() saved the in-flight requests, and that was all it reliably saved. New requests arriving during load balancer lag were refused, and a client that reuses sockets hid the refusals.

The fix: pause for longer than your balancer's lag (measure it in staging), send Connection: close while draining, start node directly so it gets SIGTERM, and test with both kinds of client.

sqlite3_rsync copies a live SQLite database without a local duplicate. Simon Willison notes that the backup API and VACUUM INTO both need disk for a full local copy. sqlite3_rsync, in SQLite since 3.47.0, sends a snapshot over SSH instead: the replica sends page hashes and the origin returns only pages that differ. That rescues the small box whose disk is already more than half full.

A slow migration that paid off

GitHub spent three years moving github.com from styled-components to CSS Modules. GitHub reports 55% less server-side rendering time and 25% faster component initialization. Each Primer component got a CSS Modules variant behind a feature flag, checked with visual regression tests and rolled out to the Primer team, then staff, then everyone.

A transitional package let roughly 7,760 sx prop usages keep working during the crossover. Eight engineers migrated 6,419 of them in six months; two engineers cleared the last 895 in three weeks with Copilot coding agents. The method travels: a compatibility shim, flags per component and a staged audience.

Before scaling out, ask which part of the system owns state and which part could be thrown away.

← All Morning Merge Architecture issues

Get this in your inbox every morning.

Free. Five minutes. Unsubscribe in one click.

Subscribe free →