Change the inputs. Watch the system respond.
Interactive system design simulators for caching, sharding, replication, consensus and more. Intuition beats memorising.
- 1Pick an idea. Each simulation is one big idea in system design, explained in plain words first.
- 2Start from an experiment. One click sets up a situation. Then change any knob and watch the system respond.
- 3Check what stuck. Read how real systems do it, answer four questions, and follow links to go deeper.
Open a simulator, try its experiments, and press Mark as understood when it makes sense. Kept in this browser, and with your account when you are signed in.
Storing and finding data
How data is kept on disk, found quickly, and searched by place.
- CachingLRU vs LFU vs FIFO. See why a small cache can absorb most traffic.Starter10 to 15 min7 experiments
- Cache patterns and stampedesCache-aside, write-through and write-back, and a mass expiry hitting the database.Starter10 to 15 min7 experiments
- Database indexesPages read with and without an index, and what each index costs a write.Starter10 to 15 min6 experiments
- LSM tree against B-treeWrite cost, read cost and compaction for the two storage engines under most databases.Intermediate15 to 20 min6 experiments
- PaginationOffset against keyset: cost at depth, and what happens as rows arrive.Starter10 to 15 min7 experiments
- Bloom filters and sketchesBloom filter, HyperLogLog and count-min sketch: small memory, small known error.Intermediate10 to 15 min7 experiments
- Nearby searchGrids, geohash cells and quadtrees, and the edge problem that loses results.Starter10 to 15 min6 experiments
Spreading and protecting data
Splitting data across machines, and keeping it safe when machines fail.
- ShardingHash, range and consistent hashing: balance, hotspots and resharding cost.Intermediate10 to 15 min6 experiments
- Consistent hashingNodes on a ring: add and remove them and see how few keys move.Intermediate10 to 15 min6 experiments
- Erasure coding and durabilityCopies against erasure codes: how cloud storage reaches eleven nines for less space.Intermediate10 to 15 min6 experiments
- Write-ahead log and commitsWhat a durable write costs, what a crash loses, and how group commit gets both.Intermediate10 to 15 min6 experiments
- ReplicationSync vs async replication, stale reads and what a failover loses.Intermediate10 to 15 min6 experiments
Copies and agreement
Keeping copies in step, agreeing on one answer, and what happens when they disagree.
- CAP theoremPartition the network and see CP and AP systems behave differently.Intermediate10 to 20 min6 experiments
- Eventual consistency and conflictsLast write wins, detecting conflicts, and CRDTs when two copies disagree.Intermediate10 to 15 min7 experiments
- Leader election (Raft)Crash the leader or split the network and watch five servers keep agreeing.Intermediate15 to 20 min6 experiments
- Distributed transactionsTwo-phase commit against a saga when a service fails or says no.Intermediate10 to 15 min6 experiments
- Transaction isolationDirty reads, lost updates and write skew at each isolation level.Intermediate15 to 20 min7 experiments
- Locks and fencing tokensA lease that expires while its holder is paused, and the token that makes it safe.Intermediate10 to 15 min6 experiments
- Gossip and failure detectionNews spreads like a rumour, and silent nodes are noticed.Intermediate10 to 15 min7 experiments
- Clocks and orderingWhy timestamps lie, and how Lamport and vector clocks count causes instead.Intermediate15 to 20 min6 experiments
- A cluster, end to endAdd and kill nodes, split the network, and watch keys, leadership and traffic react together.Intermediate10 to 15 min5 experiments
Keeping a service up
Sharing traffic, protecting a service, and surviving failures and retries.
- Load balancingSix strategies against slow servers, big requests, busy clients and failures.Starter10 to 15 min6 experiments
- Rate limitingFixed window, sliding window, token bucket and leaky bucket against bursts.Starter10 to 15 min6 experiments
- Retries and circuit breakersWhy retries fix blips and worsen outages, and how a breaker helps recovery.Intermediate10 to 15 min6 experiments
- IdempotencyHow retries charge twice, and how idempotency keys stop it.Intermediate10 to 15 min6 experiments
- Delivery guaranteesAt most once, at least once and exactly once, with a consumer that crashes.Intermediate10 to 15 min6 experiments
- Event-driven architectureKafka-style partitions, keys, consumer groups and lag.Intermediate10 to 15 min6 experiments
- AutoscalingA spike against policies that react, count the queue, or look ahead.Intermediate10 to 15 min7 experiments
- DNS and TTLHow long visitors keep reaching the old address after a change, and what a short TTL costs.Starter10 min6 experiments
Speed and waiting
Why systems get slow, and where the time goes.
- Database scalingCaches, replicas and shards against reads, writes and load.Starter10 to 15 min5 experiments
- Queues and latencyWhy latency climbs steeply as servers fill up, and what headroom buys.Intermediate10 to 15 min6 experiments
- Tail latencyWhy a wide fan-out meets a slow call, and how hedging cuts the tail.Intermediate10 to 15 min6 experiments
- CDN and edge cachingHit ratio, freshness, and the surge on the origin when a purge empties the caches.Starter10 to 15 min7 experiments
- News feed fan-outPush, pull and hybrid feeds, and the celebrity problem.Intermediate10 to 15 min6 experiments
Want to build the real thing? The Code Labs have you write and run these pieces in your browser, the System Builder lets you draw a whole system and run traffic through it, the Chaos Lab breaks a ready-made design on purpose so you can see what survives, and the Cost Estimator turns your traffic into a monthly bill, and the Whiteboard gives you a blank page for sketching one out by hand, and System Architect Survival turns ten escalating incidents into a scored game.