SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
  • What is System Design?
  • High-Level Design (HLD)
  • Low-Level Design (LLD)
  • Functional vs Non-Functional Requirements
  • Back-of-the-Envelope Estimation
  • Numbers Every Engineer Should Know
  • SLA, SLO and SLI
  • Basic OS: Process, Thread, Memory
  • 30 Must-Know Concepts
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Foundations/Introduction

Back-of-the-Envelope Estimation

Quick maths for requests per second, storage and bandwidth, before you design anything.

⏱ 15 min readBeginnerMust KnowInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

Back-of-the-envelope estimation is quick, rough maths you do before designing, to learn how big the system must be.

  • You estimate requests per second, storage and bandwidth from a few simple guesses.
  • Round the numbers hard. You want the right size (hundreds or millions?), not the exact answer.
  • The answer tells you if one server is enough, or if you need caches, replicas and sharding.
  • Useful trick: a day has about 100,000 seconds, so 1 million requests a day is only about 12 per second.

02Concept: What is it?

The name comes from doing sums on the back of an envelope. In system design it means turning a vague sentence, such as "50 million people use our app every day", into numbers you can design with.

You always follow the same chain: users → requests per day → requests per second → peak load → storage → bandwidth → number of servers.

The estimation chain
👥Usersdaily active
→↓
🖱️Requests / dayusers × actions
→↓
⏱️Per second÷ 86,400
→↓
📈Peak× 2 to 3
→↓
💾Storage + bandwidth
Each step uses the result of the step before it.

The round-number rules

RuleWhy it helps
1 day ≈ 100,000 seconds (really 86,400)Divide daily requests by 100,000 for a quick per-second number
1 million per day ≈ 12 per secondA fast way to size any daily number
1 KB = 1,000 bytes, 1 MB = 1,000 KB, 1 GB = 1,000 MBEasy powers of ten; the small error does not matter
Peak ≈ 2 to 3 × averageTraffic is not even. Design for the busy hour, not the average
1 year ≈ 365 days ≈ 30 million secondsHandy for yearly storage and cost
8 bits = 1 byteNetwork speed is in bits, file sizes are in bytes
🧠Show your steps
In an interview, say each assumption out loud and write the units next to every number. A wrong assumption that you stated clearly is easy to fix. A silent one is not.

03Real-Life Example

🍵Planning a Wedding Dinner
You plan a wedding for 200 guests. You do not count each fork. You think: each guest eats about 1 plate, plus 50% extra for seconds, so about 300 plates. Each plate needs about half a kilo of food, so about 150 kg. Some guests drink more, so you add a safety margin. That is estimation: a few simple guesses, multiplied, then rounded up. You are not trying to be exact. You are trying to avoid ordering food for 20 people, or 20,000.
Wedding dinner
System estimation
200 guests
Daily active users
1.5 plates each
Actions per user per day
Half a kilo per plate
Size of each request or record
Everyone eats at 8 pm
Peak traffic (2 to 3 × average)
Extra for safety
Headroom and replicas
How many kitchens and cooks?
How many servers
Round up, do not be exact
Round every number

A worked example

A chat app has 50 million daily users who each send 40 messages a day. Each message is about 1 KB.

  • Messages per day = 50 M × 40 = 2 billion.
  • Average per second = 2 billion ÷ 100,000 ≈ 20,000 per second.
  • Peak (× 3) ≈ 60,000 per second.
  • Storage per day = 2 billion × 1 KB = 2 TB. For 5 years × 3 copies: 2 TB × 365 × 5 × 3 ≈ 11 PB.
  • Peak bandwidth = 60,000 × 1 KB = 60 MB per second, about 0.5 Gbps.

04Why Do We Need It?

📏Right-size the design
10 requests a second and 10 million need very different systems. Estimation tells you which one you face.
🚫Avoid over-building
Do not shard a database that fits on one machine.
🧯Avoid under-building
Catch the design that would fall over at peak, before you build it.
💰Estimate cost
Servers, storage and bandwidth all turn into a bill.
🔍Find the bottleneck
The biggest number points at what to worry about: CPU, storage or network.
🎤A staple of interviews
It shows you can reason with numbers, not only draw boxes.
Estimation does not give the exact answer. It tells you the size of the problem, so you pick the right tools.

05Where Do We Use It?

🎤Design interviews
Right after the requirements, to size the system.
🏗️Architecture proposals
A design document often starts with expected traffic and data growth.
🧮Capacity planning
Estimates say how many machines to order before launch.
💵Budgeting
Cloud storage and traffic are billed by the gigabyte.
🧪Load tests
Estimates give the target numbers to test against.
🧯Incident reviews
'We expected 5,000 per second but got 50,000' is a common lesson.

06Types / Parts / How It Works

The four things we estimate

EstimateHowWhat it tells you
Traffic (QPS)Daily requests ÷ 100,000, then × 2 to 3 for peakHow many app servers, and whether you need a cache
StorageNew records per day × size × days kept × copiesHow big the database is, and if you need sharding
BandwidthPeak requests per second × size of each responseNetwork cost and whether a CDN is needed
Memory (for a cache)Hot data share × total data size (often the top 20%)How big the cache must be

Reads vs writes

Most systems read far more than they write. A 100:1 read-to-write ratio is common for social feeds. Write the ratio down, because it decides whether to optimise for reads (cache, replicas) or writes (queues, sharding).

Where each number leads
Number
⏱️Requests per second
💾Storage
📡Bandwidth
Design response
🧱Load balancer, cache, replicas
🧩Partitioning and sharding
🌐CDN and compression
What you estimate What you may add
Big traffic points at servers and caches. Big storage points at sharding. Big bandwidth points at a CDN.
VisualizerEstimate load, storage and bandwidth, step by stepPick an example, then change the users, actions, size and read-to-write ratio. Watch every line of the arithmetic update, and see how fast the peak load grows.
Start from an example (then change any slider)
Peak is how many times the average?
1. Requests per day
50 M users × 60 actions
3 B
2. Average per second
3 B ÷ 86,400 s (rule of thumb: ÷ 100,000 = 30 K)
34.7 K /s
3. Peak per second
34.7 K × 3 (peak is 2 to 3 times the average)
104 K /s
4. Writes and reads per day
1 write for every 2 reads: writes = 3 B ÷ 3
1 B W, 2 B R
5. New storage per day
1 B writes × 1 KB
1 TB
6. Storage for 5 years
1 TB × 365 × 5 × 3 copies
5.5 PB
7. Peak bandwidth
104 K /s × 1 KB (bytes × 8 for bits)
104 MB/s = 0.83 Gbps
8. App servers
104 K ÷ 1 K per server
about 105
Average
34.7 K /s
requests per second
Peak
104 K /s
3× average
Storage
5.5 PB
5 years
Bandwidth
0.83 Gbps
at peak
About 104 K requests per second at peak. One database will not take this. Think caching, replicas and sharding.

Rough teaching maths, not a forecast. Units are the easy 1,000-based ones (1 KB = 1,000 bytes). The server speed is a made-up starting point: real servers depend on the work done per request, so measure yours. Real systems also add overhead, indexes and growth.

07How to Use It / Steps / Implementation

An estimation routine you can repeat

  1. 1
    State the assumptions
    Daily active users, actions per user per day, size of one item, read-to-write ratio, years of data. Say them out loud.
  2. 2
    Requests per day
    Users × actions. Round it: 50 million × 40 = 2 billion.
  3. 3
    Average per second
    Divide by 100,000 (or 86,400 if you want to be careful).
  4. 4
    Peak per second
    Multiply by 2 to 3. For a sale or live event, use a bigger factor.
  5. 5
    Storage
    New items per day × size × 365 × years × copies (often 3). Do not forget replicas and indexes.
  6. 6
    Bandwidth
    Peak requests per second × response size. Remember bytes × 8 = bits.
  7. 7
    Servers and cache
    Peak ÷ what one server handles. Estimate the cache as roughly the hottest 20% of the data.
  8. 8
    Sanity check
    Does the result make sense? Compare with a known system. If it is off by 1,000 times, find the slip.
💡Use powers of ten
Keep numbers as 2 × 10⁹ instead of 2,000,000,000. Add the exponents when you multiply. It avoids mistakes with zeros.
⚠️Watch the units
KB versus MB versus GB, and bits versus bytes, cause most errors. Write the unit beside every number.

08Key Terms to Know

TermMeaning in easy words
EstimationA quick, rough calculation to find the size of a problem
DAUDaily active users: people who use the product on a given day
QPS / RPSQueries or requests per second
Peak loadThe highest traffic in a period, often 2 to 3 times the average
Read:write ratioHow many reads happen for each write
StorageThe space needed for data, including copies and indexes
Replication factorHow many copies of each item are kept (often 3)
BandwidthData moved per second over a network link
Orders of magnitudeDifferences of 10 times, 100 times, 1,000 times: the scale we care about
HeadroomSpare capacity above the peak, for spikes and failures
Hot dataThe small share of data that gets most of the traffic

09Pros, Cons and Trade-offs

✅ Pros
  • Fast: a few minutes of maths
  • Shows the right size before any building
  • Finds bottlenecks early
  • Gives a base for cost and capacity
  • Builds trust in a design discussion
⚠️ Cons
  • Based on guesses that may be wrong
  • Hides detail (bursts, hot keys, overhead)
  • Easy to slip on units and zeros
  • Gives false comfort if you never check real numbers
  • Different assumptions give very different results

Trade-offs

ChoiceWe gainWe lose
Round hardSpeed and claritySome accuracy (usually fine)
Plan for a high peakSafety in spikesHigher cost when traffic is average
Plan for the averageLower costFailures during the busy hour
Add many copiesDurability and read speedMore storage and write cost
Estimate far ahead (5 years)Fewer redesignsMore chance that the guesses are off
Detailed modelMore realistic numbersMore time, and often false precision

10Common Problems and Mistakes

Common mistakes

  1. Using the average as the peak. The system dies at the busiest hour.
  2. Mixing bits and bytes. A 1 Gbps link moves about 125 MB per second, not 1 GB.
  3. Forgetting copies and indexes. Real storage is often 3 times or more than the raw data.
  4. Counting all users as active. Total users and daily active users are far apart.
  5. Over-precision. 11.37 PB sounds exact but the guesses behind it are not.
  6. Skipping the sanity check. A result of one billion requests per second for a small app should ring a bell.

Things to watch

🔥Hot spots
Traffic is not even across keys or users. One celebrity can use more than a million normal users.
📈Growth
Add the growth rate for the planning period.
⏰Daily shape
Most traffic comes in a few hours, so the peak can exceed 3 times the average.
🧮What one server can do
It depends on the work per request. Measure, do not trust a round number.

11Real-World Examples

🐦A short-post service
Read-heavy: a post is written once and read many times, so the design leans on caching.
📷A photo app
Storage and bandwidth dominate. Files go to object storage and a CDN.
🎥Video streaming
Bandwidth is the largest cost, so edge caches matter a lot.
💬A chat app
Many small writes, with a long storage history to plan for.
🛒A flash sale
Peak is far above 3 times the average, so plan queues and a waiting room.
📊Metrics and logs
Constant writes. Storage and retention are the main numbers.
📝Note
All the numbers on this page are teaching examples. Always use the real numbers for your product when you have them.
Mini case: from numbers to a design
🖱️2 B requests / day
→↓÷ 100,000
⏱️20,000 / saverage
→↓× 3
📈60,000 / speak
→↓÷ 1,000 each
🖥️About 60 servers
2 billion messages a day turns into about 20,000 per second on average.

12Related Topics to Read Next

Functional vs Non-Functional Requirements→

The scale target comes from the requirements.

Numbers Every Engineer Should Know→

The speeds you need for the maths.

Capacity Planning→

Turns estimates into hardware.

Latency vs Throughput vs Bandwidth→

Clear meanings for the units you estimate.

Scalability→

What to do when the numbers are big.

Sharding→

The answer when storage no longer fits.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • ✔Chain: users → requests/day → per second → peak → storage → bandwidth → servers.
  • ✔Day: about 100,000 seconds. 1 M per day ≈ 12 per second.
  • ✔Peak: 2 to 3 × the average.
  • ✔Storage: items/day × size × 365 × years × copies.
  • ✔Bandwidth: peak requests/s × size. Bytes × 8 = bits.
  • ✔Round hard: powers of ten. Write the units next to every number.
  • ✔Then ask: what is the biggest number, and what does it point to?
  • ✔One line: "Guess simply, multiply carefully, round hard, and check it makes sense."
← Previous
Functional vs Non-Functional Requirements
Next →
Numbers Every Engineer Should Know