Continue where you left off ×
Uber, the case study
Everything · Open board
The whole set on one board. This lesson tells the story of the one question the whole system exists to answer, and by the end you’ll know the handful of tricks that make answering it, a million times a second, possible.
Boards
Before you start. You need to already be comfortable with the idea that a system can be forced to choose between always answering and always being right the moment a network breaks, and that splitting a huge pile of data across many machines by some key is what makes a big system fast at all. Nothing else is assumed, every other idea here is shown working before it’s named.
The idea in 30 seconds
Uber’s whole design starts from one question asked off a phone: which car can reach this exact spot soonest?
Checking every car for every question doesn’t scale. Chopping the map into fixed tiles (cells) and filing each car under the one it’s in turns the question into a lookup.
The same tile also decides which single machine handles it, so a nearby question and a nearby car always land in the same place.
Booking a driver, tracking a ride’s stage, and moving money are the three places this design insists on being exactly right. Everywhere else, being a few seconds stale is fine.
A reservation locks one driver before anyone is told. A state machine tracks a ride through fixed stages and survives a crash. An idempotency key and a balanced ledger keep money from ever moving twice.
A price that just mirrors supply and demand spikes and collapses within seconds. Capping and smoothing it turns a lottery into a signal a driver can act on.
Read the story
Lesson 106 of 115 in System Design
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson 2008: a cold Paris night, and a cab that never came 2010: San Francisco, and the question every ride starts with The count that breaks the question The trick: chop the map into tiles Two dispatchers reaching for the same car December 2013: a snowstorm, a $415 receipt, and a price nobody could explain A ride that has to survive its own phone call The charge that couldn’t tell if it already happened One system, run as many small ones Location Firehose & Geo-Index, the tile trick, by its real names Dispatch & Matching, batching beats greedy, measured Surge Pricing, a control loop, by the numbers The Trip State Machine, the guards that keep it correct Payments & Money, exactly-once, without exactly-once delivery Maps, Routing & ETA, the map that updates itself Scale, Cells & Data Platform, running it everywhere without going fully dark Terms it explains: cell, reservation, state machine, idempotency key, ledger, S2, H3, hexagons, shard key, Hungarian algorithm, DISCO, Cadence, Temporal, Contraction hierarchies, A\, DeepETA, Schemaless, Cassandra, Redis, Ringpop, ;, (consistent hashing);, (a datastore on MySQL);, /, (the workflow engine);, S2 Geometry.
Review System Design
Connects to
Splitting the ledger (sharding) System Design The cut phone line (CAP, done properly) System Design The Two Ledgers Must Agree (Distributed Transactions) System Design Charged Twice (idempotency & exactly-once) System Design The Ledger Everyone Reads (event-driven & the log) System Design The Right Book for the Job (databases, deeply) System Design Discord, the case study System Design Instagram, the case study System Design YouTube, the case study System Design Slack, the case study System Design Figma, the case study System Design Cloudflare, the case study System Design Dropbox, the case study System Design Amazon, the case study System Design OpenRouter, the case study System Design Netflix, the case study System Design WhatsApp, the case study System Design Twitter (X), the case study System Design Zomato, the case study System Design Google Search, the case study System Design Mark as read Saved in this browser, and to your account when you sign in.