Capacity planning: turn users into requests, storage, and bandwidth
Capacity Planning
5 of 5
When and How Much to Scale
The math that tells you your deadline β before users tell you with crashes.
Scaling shouldn't be a response to an outage. It should be a scheduled event on your calendar. With the growth rate and your server ceiling, you can calculate *exactly* when you'll run out of runway β and book the work in advance.
Formula
Months until capacity = log(capacity / currentRPS) Γ· log(1 + monthlyGrowth%)
capacityservers Γ RPS/server β your current maximum throughput
currentRPSYour present load (from monitoring, or your RPS estimate)
monthlyGrowth%0.15 = 15%/month. Startup: 20-50%. Mature app: 2-5%.
Add 20-30% headroom to the ceiling β never run at 100%. Scaling takes 2β4 weeks to provision and test.
Vertical scalingBigger machine. Fast to implement. Hits hardware ceiling and creates single-point-of-failure. Good for databases short-term.
Horizontal scalingMore machines. Linear cost scaling. Requires stateless design β sessions can't live on one server. Best for API layers.
Read replicasClone your DB for reads. 1 write master + N read replicas. Cheap way to handle 5β10Γ read traffic without sharding.
Caching99% cache hit rate converts 660,000 read RPS into 6,600 DB reads. Always cache before you shard. Measure hit rate.
π‘
Rule: Cache first β Read replicas β Horizontal scaling β Sharding. Each step is 10Γ harder than the previous. Only go as far as the math demands.
