Back-of-the-envelope calculations are rough, quick estimates used to gauge how much infrastructure, bandwidth, or storage your system might need before doing detailed planning.
Think of it as engineering intuition: you don't need precise numbers, just enough to make decisions and sanity-check feasibility.
Why It's Important
When scaling systems to millions of users:
- You need to know how many servers you might need.
- You need to know how much bandwidth or storage to provision.
- You need to know if your architecture can handle peak loads.
BoE estimations allow you to answer these questions quickly, without waiting for detailed load testing or simulations.
Power of Two
In computer systems, most resources – memory, storage, network buffers – are organized in powers of two:
1, 2, 4, 8, 16, 32, 64, 128,…
This is because binary systems in computers naturally allocate memory and storage blocks of 2^n.
Why Powers of Two Are Useful in BoE
- Rough estimation is easier
- Instead of calculating exact numbers, rounding to the nearest power of two gives a good approximation.
- Example: If you need 3,000 users per DB shard, estimate 4,096 users per shard -> simplifies planning.
- Memory alignment
- Most RAM and disk blocks are sized in powers of two (e.g., 4 KB pages).
- Estimating in powers of two avoids underestimating resource needs.
- Network and bandwidth calculations
- Buffers, packet sizes, and throughput often scale in powers of two.
- Server and cluster scaling
- Horizontal scaling often doubles capacity (2, 4, 8, 16 servers) -> fits naturally with powers of two.
Example:
Suppose your back-of-the-envelope calculation shows you need 7 web servers.
- Using powers of two, you round up to 8 servers.
- This makes load balancing and partitioning simpler, and keeps a spare for failover.
Quick Reference of Powers of Two
| Power | Value | Approximate Human-Friendly Size |
|---|---|---|
| 2^0 | 1 | 1 byte |
| 2^10 | 1,024 | ~1 KB |
| 2^20 | 1,048,576 | ~1 MB |
| 2^30 | 1,073,741,824 | ~1 GB |
| 2^40 | 1,099,511,627,776 | ~1 TB |
| 2^50 | ~1 PB | ~1,125 TB |
Queries Per Second (QPS)
The number of queries (read or write) a system (usually a database) received per second.
It's one of the most important metrics in capacity planning because it tells you how much load your database or API needs to handle.
Read queries: Select
Write queries: Insert, Update, and Delete
Storage Units
When building systems that scale to millions of user, you need to estimate how much storage your data will occupy. To do that, it's essential to understand storage units and how they scale.
Common Storage Units
| Unit | Abbreviation | Size in Bytes |
|---|---|---|
| Byte | B | 1 byte |
| Kilobyte | KB | 1 KB = 1,024 B (~10³ B in approximate usage) |
| Megabyte | MB | 1 MB = 1,024 KB (~10⁶ B) |
| Gigabyte | GB | 1 GB = 1,024 MB (~10⁹ B) |
| Terabyte | TB | 1 TB = 1,024 GB (~10¹² B) |
| Petabyte | PB | 1 PB = 1,024 TB (~10¹⁵ B) |
| Exabyte | EB | 1 EB = 1,024 PB (~10¹⁸ B) |
| Zettabyte | ZB | 1 ZB = 1,024 EB (~10²¹ B) |
| Yottabyte | YB | 1 YB = 1,024 ZB (~10²⁴ B) |
Leave a comment
Your email address will not be published. Required fields are marked *


