~learn.
0:00 / 1:29
Side quest 9 · Uber

A region dies with 200,000 trips in progress

transcript

Friday, 6 PM. The region serving a big city goes down. 200,000 trips in progress. What do you save first?

Copy everything to the other region? That's half a million pings a second. And every one is out of date in 4 seconds. Costs a lot. Buys almost nothing. Trips are different. Who's riding with whom. The locked fare. The status. Those are replicated active-active. The healthy region can serve them.

Locations are soft state. Trips are money.

The driver's app keeps the trip and its GPS trail locally. It reconnects. The healthy region loads the trip. Nothing lost, nothing re-priced. The next ping lands in the location index. Nobody copied it. It refills itself. A ping cycle or two later, new rides get matched again.

But here's the catch. At drop-off, the driver taps complete. It times out. So they tap again. Charge the rider twice? No. Same trip ID, already completed. The old result comes back. One charge.

One more thing. Say 300,000 drivers reconnect. Each one pings every 4 seconds. That's 75,000 extra updates a second. Plan that headroom before the outage.

Ask which state is precious, and which rebuilds itself. Replicate the money. Let the rest rebuild itself.

Full breakdown in the lecture.