From the makers of InfraSim: System Design Game
System design, measured
Each guide sets up a small system, runs it on InfraSim's simulation with a fixed seed, changes one thing, and shows what moved.
What is a retry storm?A retry storm is retries piling onto a dependency that is already struggling. In one simulated checkout, two retries per call took errors from 0% to 72% while a payment provider was slow.
What is a thundering herd?A thundering herd, or cache stampede, is every cache miss hitting the database at once. A simulated mass expiry failed 54% of requests for three seconds. Jittered TTLs or one refill per key took that to zero.
Horizontal vs vertical scalingHorizontal scaling adds machines, vertical scaling makes one machine bigger. At the same capacity and cost, one big instance was faster in our simulation, and it was also the one that dropped to 0% when its zone went down.
What do read replicas fix?Read replicas copy reads, not writes. In a simulated shop, two replicas held 99.99% availability on reads and fell to 45.7% when saves took over. A bigger primary with no replicas held 99.93% for less money.
Load balancer vs CDNA load balancer spreads requests across your servers. A CDN answers requests near the user so they never reach your servers. In a simulated two-continent shop, a CDN cut p95 from 197 ms to 67 ms and app traffic by three quarters.
Queue backpressureA queue hides slow consumers instead of fixing them. When simulated workers slowed down, the backlog reached 19,129 jobs, a 231.9 second wait for new work. Capping the queue dropped 14,129 jobs. Scaling workers on depth cleared it within 45 seconds of the jam.
Rate limiting, global vs per clientA global rate limit protects your servers but cannot tell a bot from a customer. In a simulated bot flood, a 2,000 rps global limit turned away 59% of real shoppers. Filtering bots at the edge turned away none.
p95 vs average latencyp95 latency is the time 95% of requests beat. On a simulated pool at 30% busy, mean and p95 were 27 ms and 42 ms. At 90% busy they were 164 ms and 524 ms: the tail grew more than twice as fast.
Why autoscaling is too slow for a spikeAutoscaling reacts to load it has already seen, then waits for new machines to boot. In a simulated 4× spike, that meant 29 seconds at 74% errors. A higher minimum cut it to 3%.
What is a hot partition?A hot partition is one shard of a table taking most of the traffic. In a simulated sale, a poor partition key failed 56% of requests. Buying 20,000 units of capacity changed nothing. A better key or a cache took it to 0.06%.
Get InfraSim: System Design Game
InfraSim is a system-design game: drag load balancers, caches, databases and queues onto a canvas, deploy, and watch simulated live traffic flow through what you built. Then survive traffic spikes, zone outages and bot swarms across a guided campaign, endless Survival runs and a Daily Challenge. Tutorial and 15 levels free, with optional InfraSim Pro.