Caching Lab: Interactive Simulations & Lessons
Hit rates, TTLs, invalidation, stampedes and CDNs. A hands-on caching lab with 3 interactive simulations and 3 lessons.
Hit rates, TTLs, invalidation, stampedes and CDNs.
Caching is the cheapest performance win and the most common source of “but I just updated it!” bugs. Tune a cache, then break it.
Simulations
- Cache: Hits, Misses, TTL & Invalidation — Serve product reads through a cache; tune TTL and size, update the database and watch stale reads and stampedes.
- Load Balancing Algorithms — Send traffic through round robin, least connections, weighted and consistent-hash balancers; make one server slow.
- Consistent Hashing Ring — Place keys on a hash ring, add or remove servers, toggle virtual nodes, and compare key movement with modulo hashing.
Lessons
- Caching: Speed at the Cost of Truth — Level 8 · Data Systems
- Facade & Proxy: Simple Front Doors and Smart Stand-ins — Level 4 · Design Patterns
- Replication Lag: When Your Own Write Disappears — Level 8 · Data Systems
Also explore
- Build Your Own Cache — Build it yourself
- Cache-Aside — Pattern
- Video Streaming Platform — Case study
Other labs
- Kafka Lab — Logs, partitions, keys, consumer groups and ordering.
- Database Internals Lab — Storage engines, indexes, replication and partitioning.
- Transactions Lab — Isolation anomalies, lost updates and distributed transactions.
- Microservices Lab — Failures, retries, circuit breakers, sagas and idempotency.
- Architecture Lab — Evolution, decisions, characteristics and fitness functions.