Playgrounds¶
Simulations live on the host concept page, next to the failure they illustrate. This hub does not duplicate canvases. Read the mental model, predict the log line, then press the dangerous button.
Structured drills (hot partitions, replica loss, latency, packet loss, hot keys, …) on these same canvases: Failure-injection tasks.
| Simulation | What you learn | Host |
|---|---|---|
| Consistent hashing ring | Add/remove a node; only a slice remaps | Consistent hashing |
| Quorum replication | RF, W/R quorum, kill/heal nodes, latency spike → availability, write success, staleness | Replication |
| Database sharding | Hash shards, 70% hot key, reshard cost | Sharding |
| Kafka partitions & groups | Parallelism = partitions; extra consumers idle; kill → rebalance | Kafka |
| Cache stampede | Hot key expires; lock / jitter / SWR | Cache stampede |
| Cache capacity | Working set vs. cache size vs. TTL → hit rate, DB QPS, stampede size | Cache strategies |
| Rate limiter | Token bucket vs windows; burst → reject | Rate limiting |
| Load balancer | RR / weighted / least-conn / hash; dead backend | Load balancing |
| Retry storm | 1000 rps × 3 retries = you DDoS yourself | Circuit breakers |
| Circuit breaker | CLOSED → OPEN → HALF-OPEN | Circuit breakers |
| Raft election | Kill leader, partition a node, majority | Raft |
| Saga | Ship fails after charge — compensations | Sagas |
| Tail latency | p50 fine, p99 on fire; HOL / slow 1% | Tail latency |
| DNS resolution | Stub → resolver → root → TLD → auth | HTTP & TCP |
| TCP lifecycle | Handshake, drop, timeout, why pooling | HTTP & TCP |
| K8s request flow | Ingress → Service → Endpoints → Pod | Kubernetes |
| Capacity calculator | DAU → QPS, miss rate, storage, RF | Requirements · Calculators |
17 priority simulations above. 16 DSA visualizers on pattern pages (not every DSA page has one):
| Visualizer | Host |
|---|---|
| Sliding window (fixed-window max sum) | Sliding window |
| BFS / DFS | BFS & DFS |
| Coin-change DP | Dynamic programming |
| Heap insert / extract-min | Heaps |
| Dijkstra (undirected O(V²) demo) | Graph algorithms |
| Union-Find | Union-Find |
| N-Queens backtracking | Backtracking |
| Sorting comparison | Sorting |
| Trie insert / search | Tries |
| Interval scheduling | Greedy |
| KMP | String matching |
| Bloom filter | Advanced hashing |
| Count-Min Sketch | Probabilistic sketches |
| Skip list | Skip lists & range trees |
| Fenwick prefix sums | Skip lists & range trees |
| Aho-Corasick | Advanced string matching |
Foundations, two pointers, binary search, and the pattern-recognition index have no visualizer. Little's Law / nines sit on Calculators.
How to use a sim
Predict the log line before you click Kill / Fail / Hot key. If the screen surprises you, the mental model is wrong — re-read the host page.
Beyond the canvas: real environments
Several of the simulations above have a real-process counterpart in Labs — Docker Compose (and one Terraform) environments where you kill an actual Kafka broker, Postgres replica, or Redis Sentinel instead of a canvas node. The simulator teaches the mechanism in 30 seconds; the lab is the next step once you want to see the real timing and edge cases.