In a system design interview, you are often asked to estimate capacity or performance. Back-of-the-envelope calculations help you quickly judge which designs will meet requirements.
Outcomes
Data volume in distributed systems is measured using powers of 2. A byte is 8 bits. An ASCII character uses one byte.
| Unit | Value |
|---|---|
| 1 KB | 2^10 bytes = 1,024 bytes |
| 1 MB | 2^20 bytes = 1,048,576 bytes |
| 1 GB | 2^30 bytes = 1,073,741,824 bytes |
| 1 TB | 2^40 bytes = 1,099,511,627,776 bytes |
| 1 PB | 2^50 bytes = 1,125,899,906,842,624 bytes |
High availability means a system is continuously operational for a long period. It is measured as a percentage, with 100% meaning zero downtime. Most services fall between 99% and 100%. Cloud providers set SLAs at 99.9% or above.
| Availability % | Downtime per day | Downtime per year |
|---|---|---|
| 99% | 14.4 minutes | 3.65 days |
| 99.9% | 1.44 minutes | 8.77 hours |
| 99.99% | 8.64 seconds | 52.6 minutes |
| 99.999% | 0.864 seconds | 5.26 minutes |
Assumptions: 300M monthly active users, 50% use daily, 2 tweets per day per user, 10% of tweets contain media, data stored for 5 years.
Calculate DAU: 300M * 50% = 150M.
Calculate tweets QPS: 150M * 2 tweets / 24 hours / 3600 seconds = ~3500 QPS.
Calculate peak QPS: 2 * QPS = ~7000 QPS.
Calculate media storage per day: 150M * 2 * 10% * 1 MB = 30 TB per day.
Calculate 5-year media storage: 30 TB * 365 * 5 = ~55 PB.