SystemExpertsSystemExperts
Pricing

System Design Fundamentals

11 items

Scalability Fundamentals

25mbeginner

Latency, Throughput & Performance

30mbeginner

Back-of-Envelope Calculations

25mbeginner

Availability & Reliability Fundamentals

35mintermediate

CAP Theorem & Consistency Models

40mintermediate

Load Balancing Deep Dive

35mintermediate

Asynchronous Processing & Message Queues

30mintermediate

Networking & Protocols

30mintermediate

Caching Strategies

35mintermediate

System Design Fundamentals

20mintermediate

Database Fundamentals

40madvanced
Fundamentalscapacity-planningestimationback-of-envelopescalabilitymathfundamentalssystem-designbeginner

Back-of-Envelope Calculations

The math every engineer needs for system design interviews and capacity planning

Foundation knowledge|25 min read

Summary

Back-of-envelope calculations help you estimate system capacity, storage needs, and bandwidth requirements without precise data. Master the key numbers: powers of 2, latency figures, and throughput benchmarks. The goal isn't exact answers—it's getting within an order of magnitude to validate designs and identify bottlenecks. A 10x error is acceptable; a 1000x error means your design is fundamentally wrong.

Key Takeaways

Powers of 2 Are Your Foundation

Know these cold: 2^10 = 1K, 2^20 = 1M, 2^30 = 1G, 2^40 = 1T. When someone says "1 million users," you should instantly think "2^20" and know that fits in 20 bits. This mental math is the basis of all capacity planning.

Latency Numbers Define Your Architecture

Memory access is 100ns. SSD read is 100us (1000x slower). Network round-trip is 500us. Disk seek is 10ms (100,000x slower than memory). These ratios explain why we cache, use SSDs, and avoid cross-datacenter calls in hot paths.

Start with QPS, Everything Else Follows

Daily Active Users (DAU) -> requests/day -> requests/second. 100M DAU with 10 actions/day = 1B requests/day = ~12K QPS average, ~36K QPS peak (3x). From QPS, calculate storage, bandwidth, and server count.

Every system designer must memorize powers of 2. These numbers appear constantly in capacity planning, data sizes, and addressing.

| Power | Exact Value | Approximate | Common Name | |-------|-------------|-------------|-------------| | 2^10 | 1,024 | 1 Thousand | 1 KB | | 2^20 | 1,048,576 | 1 Million | 1 MB | | 2^30 | 1,073,741,824 | 1 Billion | 1 GB | | 2^40 | 1,099,511,627,776 | 1 Trillion | 1 TB | | 2^50 | ~1 Quadrillion | 1 PB |

Powers of 2 Scale

Useful conversions:

1 byte = 8 bits
1 ASCII character = 1 byte
1 Unicode character = 2-4 bytes
1 integer = 4 bytes (32-bit) or 8 bytes (64-bit)
1 UUID = 16 bytes (128 bits)
1 IPv4 address = 4 bytes
1 IPv6 address = 16 bytes
1 timestamp = 8 bytes

Quick mental math:

2^10 ~= 10^3 (off by 2.4%)
2^20 ~= 10^6
2^30 ~= 10^9

So: 2^32 = 2^30 x 2^2 ~= 4 x 10^9 = 4 billion
     (actual: 4,294,967,296)

Summary

Back-of-envelope calculations help you estimate system capacity, storage needs, and bandwidth requirements without precise data. Master the key numbers: powers of 2, latency figures, and throughput benchmarks. The goal isn't exact answers—it's getting within an order of magnitude to validate designs and identify bottlenecks. A 10x error is acceptable; a 1000x error means your design is fundamentally wrong.

Key Takeaways

Powers of 2 Are Your Foundation

Know these cold: 2^10 = 1K, 2^20 = 1M, 2^30 = 1G, 2^40 = 1T. When someone says "1 million users," you should instantly think "2^20" and know that fits in 20 bits. This mental math is the basis of all capacity planning.

Latency Numbers Define Your Architecture

Memory access is 100ns. SSD read is 100us (1000x slower). Network round-trip is 500us. Disk seek is 10ms (100,000x slower than memory). These ratios explain why we cache, use SSDs, and avoid cross-datacenter calls in hot paths.

Start with QPS, Everything Else Follows

Daily Active Users (DAU) -> requests/day -> requests/second. 100M DAU with 10 actions/day = 1B requests/day = ~12K QPS average, ~36K QPS peak (3x). From QPS, calculate storage, bandwidth, and server count.

Storage Estimation: Users x Data x Time

Storage = users x data_per_user x retention_period. 100M users x 1KB profile x 1 year = 100TB. Add 3x for replication, indexes, and headroom. Simple multiplication, but do it systematically.

Bandwidth = Data Size x QPS

If each response is 10KB and you serve 10K QPS, that's 100MB/s = 800Mbps outbound. A single 1Gbps NIC handles this. Bandwidth is rarely the bottleneck for typical web services.

When in Doubt, Use Order of Magnitude

Don't calculate 127 x 89. Just say 100 x 100 = 10,000. Being within 10x is fine for design decisions. If your estimate is 100 servers and reality is 120, no problem. If reality is 10,000, your design is wrong.

Deep Dive

Every system designer must memorize powers of 2. These numbers appear constantly in capacity planning, data sizes, and addressing.

| Power | Exact Value | Approximate | Common Name | |-------|-------------|-------------|-------------| | 2^10 | 1,024 | 1 Thousand | 1 KB | | 2^20 | 1,048,576 | 1 Million | 1 MB | | 2^30 | 1,073,741,824 | 1 Billion | 1 GB | | 2^40 | 1,099,511,627,776 | 1 Trillion | 1 TB | | 2^50 | ~1 Quadrillion | 1 PB |

Powers of 2 Scale

Useful conversions:

1 byte = 8 bits
1 ASCII character = 1 byte
1 Unicode character = 2-4 bytes
1 integer = 4 bytes (32-bit) or 8 bytes (64-bit)
1 UUID = 16 bytes (128 bits)
1 IPv4 address = 4 bytes
1 IPv6 address = 16 bytes
1 timestamp = 8 bytes

Quick mental math:

2^10 ~= 10^3 (off by 2.4%)
2^20 ~= 10^6
2^30 ~= 10^9

So: 2^32 = 2^30 x 2^2 ~= 4 x 10^9 = 4 billion
     (actual: 4,294,967,296)

Trade-offs

AspectAdvantageDisadvantage
Precision vs SpeedRough estimates (order of magnitude) enable quick design validation and interview successExact calculations provide accurate capacity planning but take longer and may not be necessary at design phase
Conservative vs Aggressive EstimatesConservative estimates (round up) provide safety margin and prevent under-provisioningOver-estimation leads to wasted resources and higher costs; reality is often lower than peak estimates
Top-Down vs Bottom-UpTop-down (DAU -> QPS -> servers) is fast and good for initial estimatesBottom-up (actual benchmarks x components) is more accurate but requires more detailed knowledge

Premium Content

Sign in to access this content or upgrade for full access.