Back-of-the-envelope estimation
Before choosing components, estimate the scale: how many requests per second, how much storage, how much bandwidth? Numbers decide whether one database is enough or you need fifty, whether data fits in memory, and what it will cost. The goal isn't precision, it's the right order of magnitude, reached quickly with round numbers.
Handy numbers
| Fact | Approximation |
|---|---|
| Seconds in a day | 86,400 ≈ 100,000 (10⁵) |
| Seconds in a month | ≈ 2.5 million |
| Seconds in a year | ≈ 30 million |
| 1 KB / 1 MB / 1 GB / 1 TB / 1 PB | 10³ / 10⁶ / 10⁹ / 10¹² / 10¹⁵ bytes |
| A character (ASCII) / an integer / a UUID | 1 byte / 4–8 bytes / 16 bytes |
| One modern server, simple API | ~1,000–10,000 requests/second |
| One relational database (well indexed) | ~1,000–10,000 writes/s, more reads |
| Redis | ~100,000+ operations/second per node |
Peak traffic is often 2–10× the average (evenings, sales, news events). Design for the peak.
Requests per second
A social app has 50 million daily active users. Each opens the feed 10 times a day and posts once every 5 days.
A 50:1 read-heavy workload suggests caching and read replicas will matter more than write throughput.
Storage
About 9 TB of rows (27 TB with replicas) is manageable for a relational database split across a few shards; nearly 2 PB of images belongs in object storage (S3, GCS) behind a CDN, never in the database.
Bandwidth
Servers and memory
How many app servers? And can the "hot" data be cached in memory?
Doing it in an interview
- State assumptions out loud and round aggressively (86,400 → 100,000).
- Write the formula before the numbers:
QPS = DAU × actions per user ÷ seconds per day. - Look for the conclusion: "read-heavy, so cache", "petabytes, so object storage", "this fits in one machine's memory".
- Keep it quick: estimation is a tool to make decisions, not the decision itself.
Practice
- A video platform has 10 million daily viewers who watch 30 minutes each at 3 Mbit/s. What's the average outgoing bandwidth?
- A URL shortener creates 100 million links per month; each record is 500 bytes. How much storage after 10 years?
- A chat app has 20 million users sending 40 messages a day. How many messages per second at a 5× peak?
1.Roughly how many seconds are in a day, for quick estimates?
2.Why design for peak traffic rather than the average?
3.An estimate shows 2 PB of user photos after five years. Where should they live?