Interactive System Design Simulations
22 interactive system design simulations: Kafka partitions, consumer groups, replication, caching, sagas, circuit breakers and more. Break it, then learn why.
Data systems
- B-Tree vs LSM-Tree — Insert keys into both engines side by side and watch page splits, memtable flushes, SSTables and compaction happen.
- Database Index — Query 10,000 ShopFlow orders with and without an index; count rows examined and see write costs rise.
- Cache: Hits, Misses, TTL & Invalidation — Serve product reads through a cache; tune TTL and size, update the database and watch stale reads and stampedes.
- Kafka Partitions & Keys — Produce keyed messages, change partition count, and see how keys map to partitions and what that does to ordering.
- Consumer Groups & Rebalancing — Add and remove consumers, crash one mid-batch, and watch partition assignment, offsets, lag and redelivery.
- Leader/Follower Replication & Failover — Write to a leader, switch sync/async replication, kill the leader, and see what failover loses.
- Replication Lag: Read-Your-Writes — Update your profile, read from a lagging replica, and fix it with read-your-writes and monotonic-read strategies.
- Transaction Isolation Anomalies — Step two concurrent transactions and reproduce dirty reads, non-repeatable reads, phantoms and write skew at each isolation level.
- Lost Updates & Optimistic Locking — Two admins edit the same product price; compare no locking, optimistic versions and pessimistic locks.
- Hash vs Range Partitioning & Hotspots — Distribute orders by range and by hash, then simulate a celebrity seller and watch a hot partition form.
Distributed systems
- Consistent Hashing Ring — Place keys on a hash ring, add or remove servers, toggle virtual nodes, and compare key movement with modulo hashing.
- Distributed Transaction: Two-Phase Commit — Coordinate Order, Payment and Inventory with 2PC; crash participants or the coordinator at each phase.
- Load Balancing Algorithms — Send traffic through round robin, least connections, weighted and consistent-hash balancers; make one server slow.
Microservices
- Saga: Compensating a Failed Checkout — Run a checkout saga as orchestration or choreography; fail any step and watch compensations unwind it.
- Circuit Breaker States — Degrade a dependency and watch the breaker trip from closed to open to half-open, with and without fallbacks.
- Retry Storm & Backoff with Jitter — Slow a service down and watch naive retries multiply traffic; add backoff, jitter and retry budgets to recover.
- Microservice Failure Cascade — Kill Payment, Inventory or Notification in a checkout chain and add timeouts, retries, breakers, async events and sagas.
- Idempotency Keys & Duplicate Payments — Click “Pay” on a flaky network, retry, and see duplicate charges disappear once idempotency keys are enabled.
Design
- DDD Bounded Contexts Workshop — Sort ShopFlow concepts into bounded contexts, see where “Customer” and “Product” mean different things, and check coupling.
- Design Pattern Playground — Add payment methods, discounts and order states to ShopFlow with and without patterns; count the classes you had to edit.
Architecture
- Architecture Fitness Functions — Add dependencies between modules and watch automated fitness functions pass or fail the build.
- Architecture Evolution Stepper — Step ShopFlow from monolith to multi-region and compare characteristics, failure points and complexity at each version.