<< back to Guides

๐Ÿ“Š System Design: Capacity Estimation (Deep Dive)

Capacity estimation helps you predict the resources your system will need to handle expected load, prevent downtime, and plan for scaling.


๐ŸŽฏ Why Capacity Estimation Matters


๐Ÿง  Inputs to Estimate

  1. Traffic Load

    • Requests per second (RPS) or queries per second (QPS)
    • Daily Active Users (DAU) / Monthly Active Users (MAU)
    • Peak load vs average load
  2. Data Size

    • Average payload size per request/response
    • Daily data growth rate (e.g., logs, user uploads, analytics)
  3. Retention Requirements

    • How long data needs to be stored (e.g., 30 days, 6 months, forever)
  4. Processing Overhead

    • CPU usage per request
    • Memory footprint per user/session
  5. Network Throughput

    • Bandwidth required for serving requests
    • Ingress/Egress load between services

๐Ÿ” Example Questions to Ask

- What is the expected RPS at launch?
- Whatโ€™s the peak traffic multiplier? (e.g., 5x daily average)
- How big is each write or read operation in bytes?
- How long do we store user logs, uploads, or sessions?
- How many database read/write ops per second are expected?

๐Ÿ“ Estimation Formula Examples

๐Ÿ“ฆ Storage Estimation

Daily Storage = Requests per Day ร— Payload Size  
Total Storage (N days) = Daily Storage ร— Retention Period

Example:
1,000,000 requests/day ร— 2 KB = ~2 GB/day  
Retention = 90 days โ†’ 180 GB total

๐Ÿงฎ Compute Estimation

Requests per second = Total Requests per Day / 86,400

If each request takes 20ms of CPU:
  CPU Load = RPS ร— 20ms
  = 1000 RPS ร— 20ms = 20 CPU cores

Add headroom (~30%) โ†’ 26 cores

๐Ÿ”„ Database IOPS Estimation

- Read Ops = RPS ร— Read ops/request
- Write Ops = RPS ร— Write ops/request

Add 50% overhead for replication/indexing

โš™๏ธ Tools & Techniques


๐Ÿงฑ Capacity Estimation Framework

1. Estimate baseline RPS / QPS
2. Factor in peak load (e.g., 2x or 10x burst traffic)
3. Estimate per-request data and processing size
4. Project data growth (daily, monthly, yearly)
5. Estimate backend capacity (DB IOPS, bandwidth)
6. Add buffer (25โ€“50%) for safety and growth

๐Ÿ’ก Pro Tips

<< back to Guides