Section 3: A Million Rides in Mid-Air - Scale Estimation & Workload Analysis
Executive Summary: This section derives every number the design will lean on from two inputs: 30 million events a day and a 20-minute mean duration. Little's Law turns those into about a million rides in progress at peak; the same arithmetic gives 1,750 writes per second, 6,000 reads per second, 20 GB of new data a day, and a formula for how many events any query returns. The verdict is the opposite of what most candidates expect: writes are small, the open set fits in memory, and the real enemy is the size of an answer.
"Before you design anything: how big is this?"
Most candidates reach for QPS first. Here the thing stored is an interval, and intervals pile up in the present, so the candidate starts with how many are alive at once.
Two Inputs, Stated Out Loud
Candidate: "I'll plan on 30 million rides a day. Uber reports roughly that across products, so it's a sane first tenant. Mean ride, pickup to drop-off, 20 minutes, hard-capped at 12 hours; anything open longer is broken. Peak is 2.5× average, about 10,000 cities, the biggest market around 4% of volume, and a record of about 200 bytes. Correct any of those and I'll redo the chain."
Interviewer: "Fine. Go."
Everything below comes from those inputs.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson