SysDesignAtlas

Back-of-the-Envelope Estimation

The numbers to memorize, a repeatable four-step method, and worked examples — plus the crucial judgment of which estimates actually change a decision.

CoreMedium9 min readestimationcapacitymath
Confidence

#The point of estimation

Not precision. Estimation exists to make architectural decisions.

If your calculation says 500 GB of data, that's one database. If it says 500 TB, that's a sharded cluster with a completely different design. The estimate is only worth doing when it flips a decision: size the storage because it determines whether you shard; skip precise CPU numbers because they don't change the architecture.

#Numbers to memorize

Time:

  • 1 day = 86,400 s ≈ 10⁵ s (this rounding is the single most useful trick here)
  • 1 month ≈ 2.6M s · 1 year ≈ 31.5M s ≈ 3 × 10⁷ s

The powers of two:

PowerApproxNameBytes
2¹⁰10³thousand1 KB
2²⁰10⁶million1 MB
2³⁰10⁹billion1 GB
2⁴⁰10¹²trillion1 TB
2⁵⁰10¹⁵quadrillion1 PB

Typical object sizes:

ThingSize
UUID / 64-bit ID16 B / 8 B
Timestamp8 B
Tweet-sized text (280 chars)~300 B
A typical database row w/ metadata~1 KB
Chat message~1 KB
Compressed HTML page~50–100 KB
Thumbnail~10 KB
Photo (web-optimized)~200 KB – 2 MB
1 min of 1080p video~30 MB
1 hour of 1080p video~2 GB

Machine capacities. These are for one ordinary rented server — "commodity" meaning nothing special, the kind you get by the hour — and they're order-of-magnitude figures:

ResourceCapacity
RAM64–512 GB
SSD throughput~500 MB/s – 2 GB/s
Network interface10 Gbps ≈ 1.2 GB/s
Postgres/MySQL writes~10–50K/s (tuned, simple rows)
Redis ops~100K/s per core, single-threaded
Kafka broker~100 MB/s – 1 GB/s
Web server (simple JSON)~5–20K QPS

#The four-step method

1. Traffic. Start from DAU — daily active users, how many distinct people use the product in a day — multiply by how often each one acts, and divide by the seconds in a day to get QPS, queries per second.

     QPS_avg  =  DAU × actions_per_user / 86,400
     QPS_peak =  QPS_avg × peak_factor        (use 2-3×; 10× for
                                               events/flash sales)

2. Storage. QPS_write × bytes_per_item × seconds — then multiply by the replication factor (how many copies of the data you keep, usually 3) and add index overhead (the extra space the database's indexes take).

     storage/day   = writes/day × bytes_per_write
     storage/5yr   = storage/day × 365 × 5
     actual disk   = storage × replication (×3) × index overhead (~1.3)

3. Bandwidth. QPS × payload size, in and out separately. Egress usually dominates and it's the one you pay for.

4. Memory (cache). Apply the 80/20 rule: cache the 20% of data serving 80% of reads. Compare to per-machine RAM to get node count.

#Worked example — a photo sharing service

Given: 500M DAU. Each user views 50 photos/day, uploads 0.2 photos/day. Average photo 1.5 MB, plus three generated thumbnails totalling ~100 KB.

Traffic:

  Reads:   500M × 50            = 25 × 10⁹ views/day
           25 × 10⁹ / 10⁵       = 250,000 QPS average
           peak ×3              ≈ 750,000 QPS

  Writes:  500M × 0.2           = 100 × 10⁶ uploads/day
           100 × 10⁶ / 10⁵      = 1,000 QPS average
           peak ×3              ≈ 3,000 QPS

Read:write ratio = 250:1. That single number is the most important output of the whole exercise — it says: aggressively cacheable, CDN-first, read replicas, and the write path can afford to be slow and do heavy processing.

Storage:

  Per upload:  1.5 MB + 0.1 MB thumbnails  = 1.6 MB
  Per day:     100M × 1.6 MB               = 160 TB/day
  Per year:    160 TB × 365                ≈ 58 PB/year
  With 3× replication                      ≈ 175 PB/year

Decision: 160 TB/day instantly rules out storing the image files themselves inside the database. They go to object storage (a service like Amazon S3, built for huge numbers of large files), and the database holds only metadata — who uploaded what, when, and where the file lives. That's the architectural fork the number bought us.

Metadata storage (the part in a real database):

  Row: photo_id 8 + user_id 8 + s3_key 100 + caption 200
       + timestamp 8 + counters 24  ≈ 350 B, round to 500 B
  Per day:  100M × 500 B  = 50 GB/day
  Per year: ≈ 18 TB/year

Decision: 18 TB/year of metadata is too much for one node over five years, so we shard on user_id. But it's small enough that the sharding is routine — no exotic solution needed.

Bandwidth:

  Egress: 750,000 QPS peak × 200 KB (served size) = 150 GB/s
  Ingress: 3,000 QPS × 1.6 MB                     = 4.8 GB/s

Decision: 150 GB/s egress is ~1.2 Tbps. No origin fleet (your own servers) serves that economically — this must be CDN-served. The CDN hit rate — the share of requests the CDN answers from its own copy without asking your servers — becomes a primary design metric rather than an optimization. At 95% hits your servers ship 7.5 GB/s; at 80% they ship 30 GB/s.

Cache sizing:

  Assume 20% of photos drive 80% of views, over a 30-day window:
  Photos in 30 days:  100M × 30      = 3 × 10⁹
  Hot 20%:            600M photos
  At 200 KB served:   600M × 200 KB  = 120 TB

  → too large for RAM. Two tiers: CDN edge (disk) holds the
    120 TB; app-tier Redis caches only metadata:
    600M × 500 B = 300 GB → ~6 nodes at 64 GB. Feasible.

#Estimating QPS from DAU quickly

The reusable shortcut, since 86,400 ≈ 10⁵:

DAUActions/user/dayAverage QPS
1M10100
10M101,000
100M1010,000
100M100100,000
1B10100,000

So: DAU × actions, drop five zeros. 500M DAU × 50 actions = 25 × 10⁹ → drop five zeros → 250K QPS. You can do this in your head mid-sentence, which is the actual skill.

#Peak factors, chosen with judgment

  • 2× — globally distributed usage, smooth (a worldwide messaging app).
  • 3× — the safe default. Single-region-ish product with a daily peak.
  • 5–10× — strong daily concentration (food delivery at dinner; a work tool at 9am local).
  • 50–1000× — event-driven spikes: ticket sales for a major tour, a flash sale, a live sports finale. These need dedicated design (queues, virtual waiting rooms, precomputed inventory), and saying so is a strong signal.

#Things people get wrong

  • Forgetting replication. Disk needs are 3× your logical data in most designs. And backups aren't free either.
  • Forgetting index overhead. Indexes commonly add 20–50% on top of table size, and they're the part that must stay in RAM to be fast.
  • Sizing for average, not peak. Averages don't page you at 3am.
  • Using exact numbers. 86,400 is worse than 10⁵ here. Round early, round hard, and say you're rounding — precision that isn't used is a tell that you don't know which numbers matter.
  • Not stating assumptions. State the assumption before the arithmetic — "assuming 500M DAU and a 100:1 read/write ratio". Then if the interviewer thinks 500M is wrong, they correct that one input and you rerun the numbers, instead of your whole answer looking wrong.

#The 60-second version

When time is tight, this is the whole thing:

  1. DAU × actions ÷ 10⁵ = average QPS. Multiply by 3 for peak.
  2. Writes/day × bytes = storage/day. Multiply by 365 × years × 3 for replication.
  3. Peak read QPS × response size = egress bandwidth.
  4. State the read:write ratio. Then say what each number changed.

That fourth step is the one that scores.

#Check yourself

What is estimation for in a design interview?Show answer
Making decisions, not being precise. Compute a number only if it flips a choice — one database or a sharded cluster, origin servers or a CDN — and say what it changed.
Turn DAU into average QPS in your head.Show answer
DAU × actions per user, then drop five zeros (a day is about 10⁵ seconds). 500M × 50 = 25 × 10⁹ → about 250,000 a second.
Which peak factor do you use, and when?Show answer
About 2× for smooth global traffic, 3× as the default, 5–10× for strong daily peaks like dinner-time delivery, and 50–1000× for event spikes such as ticket sales — which need a design of their own.
A photo service sees 250 reads for every write. What does that ratio tell you to build?Show answer
Something cache- and CDN-first with read replicas, where the write path can be slow and do heavy processing.
Your estimate is 160 TB of uploads a day. What design decision does that force?Show answer
Media goes to object storage, not database rows, with only metadata in a database.
Peak egress is 150 GB/s — about 1.2 Tbps. What follows?Show answer
No origin fleet serves that economically: a CDN is mandatory, and its hit rate becomes a primary design metric.
Which three multipliers do people forget when sizing storage?Show answer
Replication (about 3×), index overhead (20–50%), and backups. Also size for peak traffic, not average.
How many base62 characters do you need for 100 billion unique short codes?Show answer
Seven: 62⁶ ≈ 57 billion is too few, while 62⁷ ≈ 3.5 trillion is plenty.

#What to carry forward

  • Estimate only what changes a decision, and end each number with the decision it informs.
  • A day is about 10⁵ seconds: DAU × actions, drop five zeros, multiply by about 3 for peak.
  • Storage needs replication, index overhead and backups on top of the raw data.
  • The read:write ratio is often the most useful single output — it decides caching, CDN and replica strategy.
  • Round hard and state assumptions first, so a disagreement lands on the input, not the arithmetic.
00:00
/ 9m