Jeff Dean's famous latency numbers — updated for 2024 hardware. These form the foundation of every back-of-envelope calculation.
Operation
Latency
Relative Scale
Notes
L1 cache reference
~1 ns
1×
CPU register-adjacent
Branch mispredict
~3 ns
3×
Pipeline flush penalty
L2 cache reference
~4 ns
4×
4× L1
L3 cache reference
~12 ns
12×
Shared across cores
Mutex lock/unlock
~17 ns
17×
Uncontended
Main memory (RAM)
~100 ns
100×
DRAM access
Compress 1KB (Snappy)
~3 µs
3,000×
Fast compression
Send 2KB over 1Gbps NIC
~20 µs
20,000×
Network card latency
SSD random read
~100 µs
100,000×
NVMe: ~20 µs
Read 1MB sequentially (RAM)
~250 µs
250,000×
Memory bandwidth
Same datacenter RTT
~500 µs
500,000×
Within AZ
Read 1MB sequentially (SSD)
~1 ms
1,000,000×
Sequential is fast
HDD seek
~10 ms
10,000,000×
Mechanical movement
Read 1MB sequentially (HDD)
~20 ms
20,000,000×
After seek
Send packet CA→NL→CA
~150 ms
150,000,000×
Speed of light limit
Key Insight: Memory is 100× faster than SSD, SSD is 100× faster than HDD, and local is 1000× faster than cross-continent. Design your hot path to stay in memory.
Visual Latency Scale (Logarithmic)
Network Latency Breakdown
What happens during a typical HTTPS request — each phase adds latency
Jeff Dean's Numbers (2024 Updated)
Operation
2012
2024
L1 cache
0.5 ns
~1 ns
L2 cache
7 ns
~4 ns
RAM
100 ns
~80-100 ns
SSD random read
150 µs
~16-100 µs (NVMe)
HDD seek
10 ms
~4-10 ms
1 Gbps send 1MB
10 ms
~1 ms (10Gbps+)
Datacenter RTT
500 µs
~200-500 µs
Latency Rules of Thumb
🟢 Fast (<1ms): In-memory ops, cache hits, local IPC
🟡 Medium (1-10ms): DB queries, SSD reads, same-region calls
🟠 Slow (10-100ms): HDD, cross-AZ, external API calls
🔴 Very Slow (>100ms): Cross-region, cold starts, DNS lookups
Optimization Priority: Cache hot data → reduce network hops → batch I/O → move compute closer to data
Throughput Numbers
Capacity benchmarks for common systems — use these for back-of-envelope sizing. Numbers assume modern hardware (2024) with proper tuning.
System
Read Throughput
Write Throughput
Notes
PostgreSQL
~10-30K reads/sec
~1-5K writes/sec
Single node, indexed queries
MySQL (InnoDB)
~10-25K reads/sec
~1-5K writes/sec
Similar to Postgres
Redis
~100K-1M ops/sec
~100K-500K ops/sec
In-memory, single-threaded per shard
Memcached
~200K-1M ops/sec
~200K-1M ops/sec
Multi-threaded, simple K/V
Cassandra
~20-50K reads/sec/node
~50-100K writes/sec/node
Write-optimized LSM tree
DynamoDB
Unlimited (auto-scale)
Unlimited (auto-scale)
Per-partition: 3K RCU, 1K WCU
MongoDB
~20-50K reads/sec
~10-30K writes/sec
Single node, WiredTiger
Kafka
~1M+ msg/sec (consume)
~1M+ msg/sec (produce)
Per cluster, partitioned
RabbitMQ
~20-50K msg/sec
~20-50K msg/sec
Per node, persistent
Elasticsearch
~10-50K queries/sec
~10-50K docs/sec indexing
Depends on query complexity
S3
~5,500 GET/sec/prefix
~3,500 PUT/sec/prefix
Partition prefixes for more
NGINX / HAProxy
~100K-500K concurrent connections
Event-driven, non-blocking
gRPC
~50-100K RPC/sec per server
HTTP/2 multiplexing
Throughput Comparison (Relative Scale)
Connections per Server
🟢 Event-Driven (epoll/kqueue)
Runtime
Connections
NGINX
500K-1M
Node.js (libuv)
100K-500K
Netty (Java)
100K-500K
WebSocket server
500K-1M
🟡 Lightweight Threads
Runtime
Concurrency
Go goroutines
100K-1M
Erlang processes
1M+
Java virtual threads
100K-1M
Rust async (tokio)
500K-1M
🔴 OS Threads
Runtime
Threads
Java (platform)
5K-10K
Python (GIL)
~1K effective
C++ threads
10K-50K
Linux max
~32K default
Scaling Rule: For WebSocket-heavy apps (chat, gaming, live updates), budget 500K connections per server with epoll. For request/response APIs, budget 10-50K RPS per server depending on processing complexity. Horizontal scaling = more servers, not bigger servers.
Storage & Size Estimation
Know the size of common data objects and storage tiers to quickly estimate capacity requirements.
The most critical skill in system design interviews. Master these formulas and you can size any system in 5 minutes.
Core Estimation Formulas
═══ TRAFFIC ═══
Total Users → DAU = Total × DAU% (typically 10-30%)
Requests/day = DAU × actions_per_user
RPS (avg) = Requests/day ÷ 86,400 (seconds in a day)
RPS (peak) = RPS_avg × peak_multiplier (typically 3-5×)
═══ STORAGE ═══
Storage/day = Requests/day × avg_object_size
Storage/year = Storage/day × 365
With replication = Storage × replication_factor (typically 3×)
With overhead = Storage × 1.3 (indexes, metadata, fragmentation)
═══ BANDWIDTH ═══
Bandwidth (avg) = RPS × avg_response_size
Bandwidth (peak) = Peak_RPS × avg_response_size
Egress/month = Bandwidth_avg × seconds_in_month
═══ SERVERS ═══
Servers needed = Peak_RPS ÷ RPS_per_server
With headroom = Servers × 1.5 (for failover + growth)
Cache servers = Hot_data_size ÷ RAM_per_server
═══ CACHE ═══
Cache size = Working_set × hit_rate_target
Working set ≈ 20% of total data (80/20 rule)
Cache hit rate target: 95-99% for read-heavy systems
Estimation Framework Flowchart
Common Estimation Patterns
System
DAU
Actions/User/Day
Object Size
Daily Storage
Peak RPS
Social Media Post
500M
2 posts + 50 reads
1 KB text + 500 KB media
~500 TB
~300K
Chat Message
100M
50 messages
500 B
~2.5 TB
~250K
Video Upload
50M
0.01 uploads + 5 views
500 MB (upload)
~250 TB
~15K uploads
Search Query
1B
5 searches
~100 B query, 10 KB result
~50 TB results
~250K
E-commerce Order
10M
0.1 orders + 20 browses
5 KB order, 50 KB page
~10 TB
~12K orders
Ride-sharing
20M
2 rides + 100 location pings
200 B per ping
~400 GB pings
~50K
Powers of 10 — Quick Reference
Powers of 2 (Storage)
Power
Value
Name
Real-World
2¹⁰
1,024
1 KB
A short paragraph
2²⁰
~1M
1 MB
A book, a photo
2³⁰
~1B
1 GB
A movie, 1K photos
2⁴⁰
~1T
1 TB
1M photos, 500h video
2⁵⁰
~1P
1 PB
Netflix library (3×)
Powers of 10 (Traffic)
Scale
RPS
Real-World Analogy
10¹
10 RPS
Personal blog
10²
100 RPS
Small SaaS app
10³
1K RPS
Medium startup
10⁴
10K RPS
Large app (Slack)
10⁵
100K RPS
Twitter, Netflix
10⁶
1M RPS
Google Search
Interview Tip: Always state your assumptions clearly. "I'll assume 100M total users, 20% DAU, 10 actions per user per day." Interviewers care more about your process than exact numbers. Round aggressively — 86,400 ≈ 100K is perfectly fine.
80/20 Rule: 20% of data generates 80% of traffic. Cache the hot 20% in Redis/Memcached. For a 1TB dataset, you need ~200GB of cache to serve 80% of reads from memory.
Rule of 72: Doubling time = 72 ÷ growth%. At 10% monthly growth, data doubles in ~7 months. At 5% monthly growth, doubles in ~14 months. Plan capacity for 2× current load minimum.
Cost Estimation
Cloud cost awareness separates senior engineers from juniors. Know these numbers to make architecture decisions that balance performance with budget.
AWS / GCP Cost Reference (2024 Pricing)
Category
Service
Spec
Monthly Cost
Notes
Compute
EC2 m5.xlarge
4 vCPU, 16 GB
~$140/mo
On-demand, general purpose
EC2 m5.4xlarge
16 vCPU, 64 GB
~$560/mo
Typical app server
Lambda
1M invocations
~$0.20
+ $0.0000167/GB-sec
Fargate
1 vCPU, 2 GB
~$30/mo
Serverless containers
Storage
S3 Standard
Per TB
~$23/TB/mo
+ request costs
S3 Glacier
Per TB
~$4/TB/mo
Retrieval: hours
EBS (gp3)
Per TB
~$80/TB/mo
Block storage for EC2
EFS
Per TB
~$300/TB/mo
Shared file system
Database
RDS (db.r5.xlarge)
4 vCPU, 32 GB
~$350/mo
Multi-AZ: 2×
DynamoDB
On-demand
$1.25/M writes, $0.25/M reads
Pay per request
ElastiCache (r6g.large)
2 vCPU, 13 GB
~$200/mo
Redis managed
Network
Data Transfer (egress)
First 10 TB
$0.09/GB
Ingress is free
CloudFront CDN
First 10 TB
$0.085/GB
Cheaper than direct
Messaging
SQS
Per 1M requests
~$0.40
Standard queue
MSK (Kafka)
3 brokers (m5.large)
~$500/mo
Managed Kafka
Monthly Cost for Common Architectures
💬 Chat App (10M DAU)
Component
Cost/mo
20 app servers (m5.xl)
$2,800
WebSocket servers (10×)
$1,400
Redis cluster (5 nodes)
$1,000
RDS Multi-AZ
$700
S3 (media, 50TB)
$1,150
Bandwidth (100TB)
$9,000
Total
~$16K/mo
🎬 Video Platform (5M DAU)
Component
Cost/mo
Transcoding (GPU)
$5,000
S3 storage (500TB)
$11,500
CloudFront CDN (1PB)
$40,000
App servers (10×)
$1,400
Search (ES cluster)
$2,000
Database (RDS)
$1,500
Total
~$61K/mo
🛒 E-commerce (2M DAU)
Component
Cost/mo
App servers (8×)
$1,120
RDS Multi-AZ (large)
$1,400
ElastiCache (3 nodes)
$600
Elasticsearch
$1,500
S3 + CloudFront
$3,000
SQS + Lambda
$200
Total
~$8K/mo
Cost Optimization Strategies
💰 Reserved Instances
Savings: 30-60% vs on-demand
1-year RI: ~30% savings
3-year RI: ~60% savings
Best for: steady-state workloads
Commit: predictable base load
⚡ Spot Instances
Savings: 60-90% vs on-demand
Can be interrupted with 2-min notice
Best for: batch jobs, CI/CD, stateless workers
Not for: databases, user-facing servers
Use spot fleets for availability
📏 Right-Sizing
Savings: 20-40% typical
Monitor CPU/memory utilization
Target: 60-70% avg utilization
Downsize over-provisioned instances
Use auto-scaling for variable load
Cost Rule of Thumb: For most applications: Bandwidth > Compute > Storage. Video/media platforms spend 60-70% on CDN/bandwidth. CRUD apps spend 50-60% on compute. Data platforms spend 40-50% on storage. Always check: "Am I paying for idle resources?"
SLA Math & Availability
Availability is measured in "nines." Each additional nine is 10× harder to achieve and 10× more expensive. Know how to calculate composite SLAs.
Availability Levels
SLA Level
Uptime %
Downtime/Year
Downtime/Month
Downtime/Week
Typical Systems
One Nine
90%
36.5 days
72 hours
16.8 hours
Batch jobs, internal tools
Two Nines
99%
3.65 days
7.2 hours
1.68 hours
Personal projects
Three Nines
99.9%
8.76 hours
43.8 min
10.1 min
Business SaaS apps
Four Nines
99.99%
52.6 min
4.38 min
1.01 min
E-commerce, fintech
Five Nines
99.999%
5.26 min
26.3 sec
6.05 sec
Payment systems, DNS
Six Nines
99.9999%
31.5 sec
2.63 sec
0.6 sec
Pacemakers, aviation
Serial vs Parallel Availability
Error Budget Concept
📊 What is an Error Budget?
Error budget = allowed downtime based on SLO. It's the "budget" you can "spend" on deployments, experiments, and incidents.
SLO
Error Budget/Month
Meaning
99.9%
43.8 minutes
~1 incident allowed
99.95%
21.9 minutes
Very tight
99.99%
4.38 minutes
Almost zero tolerance
🎯 SLO vs SLA vs SLI
SLI (Indicator): The metric you measure (e.g., latency p99 < 200ms)
SLA (Agreement): External contract with penalties (e.g., 99.9% or credits)
Rule: SLO should be stricter than SLA. If SLA = 99.9%, set SLO = 99.95%. The gap is your safety buffer before you breach the contract.
Key Insight: Adding more serial components always reduces availability. A system with 5 serial components at 99.9% each = 99.5% overall (43.8 hrs/yr downtime). Solution: add redundancy (parallel) at each layer, especially the weakest link.
Interview Quick Reference — The 20 Numbers You Must Know
Your "cheat card" for system design interviews. Memorize these anchors and you can derive everything else.
⚡ Latency Anchors
#
Fact
Anchor
1
RAM access
100 ns
2
SSD random read
100 µs
3
HDD seek
10 ms
4
Same datacenter RTT
0.5 ms
5
Cross-region RTT
150 ms
🚀 Throughput Anchors
#
Fact
Anchor
6
Redis ops/sec
100K ops/s
7
Kafka messages/sec
1M msg/s
8
PostgreSQL reads/sec
10K reads/s
9
WebSocket connections/server
500K conn
10
S3 GET per prefix
5,500/s
💾 Storage Anchors
#
Fact
Anchor
11
Tweet / short msg
~140 B
12
User profile
~1 KB
13
Photo (JPEG)
~200 KB - 5 MB
14
Video (1 min, 720p)
~50 MB
15
1 day in seconds
~100K sec
💰 Cost & SLA Anchors
#
Fact
Anchor
16
S3 cost per TB/mo
$23/TB
17
EC2 m5.xlarge/mo
~$140
18
Bandwidth egress/GB
$0.09/GB
19
99.9% downtime/yr
8.76 hours
20
99.99% downtime/yr
52.6 minutes
Quick Derivation Patterns
Interview Mnemonics
🧠 "The 100× Rule"
Each storage tier is ~100× slower:
L1 → RAM: 100×
RAM → SSD: 1000×
SSD → HDD: 100×
HDD → Network: 15×
🧠 "The 1000× Rule"
Scaling units of data:
1 KB × 1M = 1 GB
1 KB × 1B = 1 TB
1 MB × 1M = 1 TB
1 MB × 1B = 1 PB
🧠 "The Time Rule"
Seconds in common periods:
1 day ≈ 10⁵ seconds
1 month ≈ 2.5 × 10⁶ sec
1 year ≈ 3 × 10⁷ sec
Peak = avg × 3-5
Final Interview Tip: When asked "Design X for Y million users," immediately write down: (1) DAU estimate, (2) RPS calculation, (3) Storage per year, (4) Bandwidth peak. This shows structured thinking and buys you time to think about the actual architecture. Round aggressively — interviewers want to see your process, not calculator precision.
Sanity Checks: After your estimation, verify: Is RPS reasonable for the system type? (Social media: 100K+, SaaS: 1-10K). Is storage growing faster than you can afford? (If >1PB/year, you need tiered storage). Is bandwidth cost dominant? (If yes, add CDN). Are you over-provisioning? (Target 60-70% utilization).