System Design Playground
Each simulator starts with the naive approach so you can watch it break, then flips on the pattern that fixes it. Building intuition for "why" a pattern exists sticks longer than memorizing a definition.
Why API Gateway
Fan clients out to services directly, then route them through a gateway — watch auth checks and traffic spikes change.
Why Load Balancer
Pin traffic to one server versus spreading it across a fleet — watch load, errors, and failover behave differently.
Why Circuit Breaker
Let a flaky downstream call hang every caller, then trip a breaker — watch the thread pool survive instead of exhausting.
Why a Message Queue
Flood a slow consumer synchronously until the producer's thread pool dies, then buffer it in a queue — watch 503s turn into backlog and lag.
Why Replication
Spike reads on one primary until writes starve behind them, then move reads to replicas — and pay for it in replication lag.
Being built next
The patterns where the naive version fails in a way you can actually watch happen. Each one gets the same two-part treatment: an animated explainer, then a simulator you drive yourself.
Why Sharding
One hot key pins a single node at 100% while the rest idle — then shard and rebalance, and pay for it in cross-shard queries.
Why Idempotency Keys
A client retries a payment after a timeout and gets charged twice — then add an idempotency key and make the whole retry storm safe.
Why Service Discovery
Hardcoded addresses keep routing traffic to an instance that already died — then register instances and health-check them, and watch traffic reroute live.
Why Backpressure & Bulkheads
One slow dependency eats the shared pool and takes unrelated endpoints down with it — then isolate pools per dependency and contain the blast radius.
Later in the queue
Further out, and a little more involved to model — but the same format.
Why Quorum Reads & Writes
Move N, R, and W yourself and find the exact point where R + W ≤ N starts handing you a stale read.
Why a Bloom Filter
Count the disk reads wasted on keys that were never there, add the filter, then shrink the bitmap until false positives bite back.
Why a CDN
Watch latency by region and origin load with every request going to one datacenter, then cache at the edge.
Why CQRS
Reads and writes fight over the same model until both slow down — then split them, and live with projection lag.
Why Saga over 2PC
One participant hangs mid-transaction: compare a blocked 2PC coordinator against compensating saga steps.