Back-of-the-envelope estimation in system design (with a cheat sheet)

How many requests per second? How much storage? How many servers? Learn to answer in five minutes with simple maths, and let the numbers, not buzzwords, pick your design.

An envelope with quick maths scribbled on the back - 1M users times 10 posts times 2 KB equals 20 GB a month, 240 GB a year - and a circled conclusion, PostgreSQL is fine. Beside it, a crossed-out speech bubble that says "It's scalable!".
Fig. 1 — Five minutes of maths on the back of an envelope beats an hour of arguing about tools.

Two engineers are asked to design the same app.

Engineer A says: “I’ll use MongoDB. It’s scalable and fast.” The interviewer asks, “How much data will you have?” “Um… a lot?”

Engineer B grabs a pen: “One million users, about 10 posts each a month, roughly 2 KB a post. That’s 20 GB a month, about 240 GB in a year. A single PostgreSQL database handles that easily. We don’t need a distributed database.”

Same question. Engineer B didn’t know more technology. They just did the maths first.

This is back-of-the-envelope estimation: rough, quick calculations that tell you how big your system really is. You don’t need exact numbers. You need the right order of magnitude: is it 10 requests a second, or 10,000? Those two numbers lead to completely different designs.

Why estimate at all?

Because estimation answers the questions that decide your architecture:

  • Which technology? Does one database cope, or do you need to split data across many?
  • How many servers? One, ten, or a thousand?
  • How much will it cost? $50 a month, or $50,000?
  • What breaks first as you grow?

Without numbers, every choice is a guess. And guesses go wrong in both directions: you either pay for a giant system you don’t need, or launch one that falls over on day one.

The estimation chain

Every estimate follows the same chain. Each step feeds the next:

Five linked boxes from left to right. Users: daily active users and peak. Traffic: requests per second, reads versus writes. Storage: data per item times items, growth per year. Bandwidth: data per second in and out. Servers: peak load divided by what one server handles. Under the chain: state your assumptions out loud.
Users → traffic → storage → bandwidth → servers. Say every assumption out loud as you go.
  1. Users: how many people use it each day (daily active users, or DAU)?
  2. Traffic: how many requests per second (QPS, queries per second)? How many are reads, how many writes? What’s the peak?
  3. Storage: how big is one item, how many per day, and how much after a year or five?
  4. Bandwidth: how much data flows in and out each second?
  5. Servers: how many machines handle the peak, with room to spare?

The cheat sheet

You only need a handful of numbers to do this in your head:

A cheat sheet card. Time: one day is 86,400 seconds, round it to 100,000. Traffic: 1 million requests a day is about 12 per second, 1 billion a month is about 385 per second, 1 request per second is about 2.6 million a month, and peak is 2 to 3 times the average. Storage: 1 million items of 1 KB is 1 GB, 1 million of 1 MB is 1 TB, 1 billion of 1 KB is 1 TB. Bandwidth: 1 GB per second is 8 Gbps, and 1 TB a day is about 93 Mbps on average.
Cut it out, stick it on your monitor. Most estimates need nothing else.

The most useful trick: a day has 86,400 seconds, so just call it 100,000. Now “10 million requests a day” is instantly about 100 per second. You lose a little accuracy and gain a lot of speed, which is exactly the point.

A worked example: a URL shortener

Let’s estimate a service like bit.ly from scratch. The assumptions:

  • 100 million new short links a month.
  • Each link is opened about 10 times (10 reads for every write).
  • Each stored link takes about 600 bytes (the long URL, the short code, a few details).
A receipt titled URL shortener estimate. Writes: 100 million a month divided by 2.6 million seconds is about 40 per second. Reads: 10 times that, 1 billion a month, about 385 per second on average and about 1,200 at peak. Storage: 100 million times 600 bytes is 60 GB a month, 3.6 TB after five years. Short codes: 7 characters from 62 letters and digits gives 3.5 trillion codes, enough for about 2,900 years. Total at the bottom: one PostgreSQL database plus a cache is enough.
Every line is rough. Together they tell you exactly how big this system is.

Walk through it:

  • Writes: 100 million a month ÷ about 2.6 million seconds in a month ≈ 40 writes a second. Tiny.
  • Reads: 10 times that, 1 billion a month ≈ 385 a second on average, about 1,200 at peak.
  • Storage: 100 million × 600 bytes = 60 GB a month, about 3.6 TB after five years.
  • Short codes: 7 characters from 62 letters and digits gives about 3.5 trillion codes. At 100 million a month, that lasts about 2,900 years.

The conclusion: one PostgreSQL database handles 40 writes a second with ease. 1,200 reads a second is comfortable too, especially with a cache in front, because a short link never changes once it’s made, so it’s perfect for caching. No sharding, no exotic database, no microservices.

That decision took five minutes, and you can defend every part of it.

Read-heavy or write-heavy?

One number from your estimate changes the design more than any other: the ratio of reads to writes.

Two columns. Read-heavy, around 90% reads, like news sites, product catalogues and social feeds: many people read the same data, which rarely changes, so cache aggressively, add read replicas and accept slightly stale data. Write-heavy, 40% writes or more, like chat, IoT sensors, payments and logs: data changes constantly and differs per user, so use queues to absorb bursts, append-only storage and split writes across machines; caching helps less.
Find the ratio first. It tells you where to spend your effort.
  • Read-heavy systems (news sites, product catalogues, URL shorteners, social feeds) serve the same data to many people. Cache it. Add read copies of the database. A few seconds of staleness is usually fine.
  • Write-heavy systems (chat, sensors, payments, logs) change constantly, and each user’s data is different. Caching helps less. Use queues to absorb bursts, storage that appends quickly, and eventually split writes across machines.

Most apps are read-heavy, but don’t assume it. A chat app can be 40% writes, and a design tuned for reads will struggle.

How many servers?

Once you know the peak requests per second (RPS), the server count is one line:

servers = (peak RPS × safety margin) ÷ RPS per server

Say the peak is 10,000 requests a second, a load test shows one server handles 1,000, and you add a 1.5× safety margin for growth and surprise spikes:

(10,000 × 1.5) ÷ 1,000 = 15 servers

Then add about 25% for failover, so one or two servers can die without anyone noticing: about 19 to 20 servers. With auto-scaling, you might run 12 normally and grow to 20 at peak.

Notice where the “1,000 per server” came from: a load test, not a guess. Estimates get you started. Measurements keep you honest.

Failure first: when the estimate is wrong

Estimates will be wrong sometimes. Plan for it:

  • Too low. You planned for 1,000 users and got 10,000 on launch day. The database runs out of connections, CPU hits 100%, and limits you set for 1,000 users start rejecting real ones. Plan for 3 to 5 times your expected launch load, and load-test before launch.
  • Too high. You planned for a million users and built Kubernetes, multi-region and a managed everything. You got 100 users and a $5,000 monthly bill. Start small, use managed services, and scale when the numbers ask.
  • Wrong ratio. You assumed 90% reads, but it’s 60/40. Your cache keeps getting invalidated and the single write database becomes the bottleneck. Measure the real ratio as soon as you have traffic.

And design so that a wrong estimate makes the system slower, not dead. If the database is overloaded, serve slightly old data from the cache with a warning, rather than an error page. If even that fails, fail fast with a clear message instead of letting every request hang.

Puzzle: the $90,000 surprise

The culprit: polling. The app asks the server “any new messages?” every second, for every user, all day:

10,000 users × 86,400 seconds = 864 million API calls a day
                              ≈ 26 billion calls a month
at about $3.50 per million calls ≈ $90,000

The messages were never the problem. The checking was. The fix: push new messages to the app over a single open connection (a WebSocket) instead of asking every second, and only send a push notification when the user is offline.

The lesson: estimate the hidden traffic too: polling, retries, health checks, notifications multiplied by group size. One small design choice can multiply your costs by a hundred.

In the interview

When an interviewer asks “How many servers do you need?”, never answer “Kubernetes will auto-scale, so it doesn’t matter.” Instead:

  1. State your assumptions out loud: users, actions per user, size per item.
  2. Do the maths roughly, rounding freely.
  3. Use the numbers to decide: “40 writes a second, so one database is fine.”
  4. Find the bottleneck: “Reads dominate, so caching gives us the biggest win.”

Interviewers don’t care whether you get 347,000 or 350,000. They care that numbers drive your design.

Key takeaways

  1. Estimate before you design. Users → traffic → storage → bandwidth → servers.
  2. Rough is fine. You need the order of magnitude, not the decimal point. Call a day 100,000 seconds.
  3. Let numbers decide. “PostgreSQL handles thousands of writes a second; we have 40” beats “let’s use Cassandra because it scales.”
  4. Find the read/write ratio. Read-heavy → cache. Write-heavy → queues and splitting writes.
  5. Add safety margins, then verify with load tests.
  6. Count hidden traffic and cost. Polling and retries can sink a budget.

That completes the foundations: how architects think, what system design is, how to write requirements, and now how to size a system. Next, we’ll look at the shape of systems themselves: monoliths, modular monoliths and microservices.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.