Chapter 9: Appendices & Reference

9.1 Appendix A: Quick Reference Tables

Appendix A: Quick Reference Tables

These tables are the cheat sheets you will reach for during estimation exercises, interview preparation, and real-world capacity planning. Bookmark this section.

Powers of Two Table

PowerExact ValueApproximateCommon Name
2^7128
2^8256
2^101,0241 Thousand1 KB
2^1665,53665 Thousand64 KB
2^201,048,5761 Million1 MB
2^301,073,741,8241 Billion1 GB
2^324,294,967,2964 Billion4 GB (max 32-bit address space)
2^401,099,511,627,7761 Trillion1 TB
2^50~1.13 Quadrillion1 Quadrillion1 PB

Quick conversions:

1 KB = 1,024 bytes.

1 MB = 1,024 KB.

1 GB = 1,024 MB.

1 TB = 1,024 GB.

1 PB = 1,024 TB.

For estimation, treat 1 KB as 1,000 bytes and multiply cleanly.

Precision does not matter for back-of-the-envelope calculations.

Latency Numbers Every Programmer Should Know

OperationApproximate Latency
L1 cache reference0.5 ns
Branch mispredict5 ns
L2 cache reference7 ns
Mutex lock/unlock25 ns
Main memory (RAM) reference100 ns
Compress 1 KB with Snappy3 μs
Send 1 KB over 1 Gbps network10 μs
Read 4 KB randomly from SSD150 μs
Read 1 MB sequentially from memory250 μs
Round trip within same datacenter500 μs (0.5 ms)
Read 1 MB sequentially from SSD1 ms
HDD disk seek10 ms
Read 1 MB sequentially from HDD20 ms
Send packet CA → Netherlands → CA150 ms

The key insight: memory is roughly 100,000x faster than disk.

SSD is roughly 100x faster than HDD.

Same-datacenter network is roughly 300x slower than memory but 20x faster than cross-continent network. These ratios explain why caching, CDNs, and data locality matter so much.

Common System Throughput Benchmarks

ComponentTypical Throughput
Single web server (Node.js / Python)1,000-5,000 requests/second
Single web server (Go / Java / Rust)10,000-50,000 requests/second
Single Redis instance100,000-200,000 operations/second
Single PostgreSQL instance5,000-20,000 queries/second (depends on query complexity)
Single MySQL instance5,000-20,000 queries/second
Single Cassandra node10,000-50,000 writes/second
Single Kafka broker200,000-500,000 messages/second
Single Elasticsearch node5,000-15,000 queries/second
Nginx (reverse proxy)50,000-100,000 requests/second

These are rough guidelines, not exact numbers.

Actual throughput depends on hardware, query complexity, payload size, and configuration.

Use them for order-of-magnitude estimation: "If one server handles 5,000 QPS and we need 50,000 QPS, we need approximately 10 servers."

Storage and Bandwidth Estimation Cheat Sheet

Common data sizes:

Data TypeApproximate Size
Single character (ASCII)1 byte
Single character (UTF-8)1-4 bytes
Short text message (tweet, SMS)200-300 bytes
Typical JSON API response1-10 KB
Email (text only)5-50 KB
Web page (HTML + CSS)100-500 KB
High-resolution photo (compressed)2-5 MB
1 minute of MP3 audio1 MB
1 minute of HD video (compressed)100-150 MB
1 minute of 4K video (compressed)300-500 MB

Estimation formulas:

Storage = items × average size × retention period

Bandwidth = requests/second × average response size

Daily volume = items/day × average size

Monthly volume = daily volume × 30

Quick time conversions:

Seconds in a day: 86,400 (~100,000 for estimation).

Seconds in a month: ~2.5 million.

Seconds in a year: ~31.5 million (~30 million for estimation).

Availability Numbers and SLA Targets

AvailabilityDowntime Per YearDowntime Per MonthDowntime Per Week
99% (two nines)3.65 days7.31 hours1.68 hours
99.5%1.83 days3.65 hours50.4 minutes
99.9% (three nines)8.77 hours43.8 minutes10.1 minutes
99.95%4.38 hours21.9 minutes5.04 minutes
99.99% (four nines)52.6 minutes4.38 minutes1.01 minutes
99.999% (five nines)5.26 minutes26.3 seconds6.05 seconds

Combined availability: Sequential (both must work): multiply availabilities. Two services at 99.9% each: 99.9% × 99.9% = 99.8%. Parallel (one must work): 1 - (1-A₁)(1-A₂). Two services at 99.9% each: 1 - (0.001 × 0.001) = 99.9999%.