BEGINNER · 12 MIN · FREE LESSON
Caching
Explore caching through a visual, step-by-step model.
Loading interactive lesson…
BEGINNER · 12 MIN · FREE LESSON
Explore caching through a visual, step-by-step model.
Loading interactive lesson…
The durable store starts with a=1,b=2. Each operation advances one tick. Compare cache-aside, write-through and write-back; loseInvalidation demonstrates stale reads, and crash drops unflushed dirty entries.
Loading architecture diagram…
Define which store owns the latest value and when it becomes durable.
Cache-aside reads populate a cache and writes invalidate it. Write-through updates both stores in this abstract serial operation model; a real implementation must handle partial failures. Write-back acknowledges dirty cached values before persistence, so crash durability differs. TTL and LRU policy are explicit, and an expired dirty entry is flushed before removal in this model.
Durable store reads, seed 42. Plotted sample sizes respect each lesson’s explicit input limits.
Keyboard: Space play/pause · ←/→ step · R restart · 1–5 speed. Reduced motion disables transitions.
A nearby copy saves a trip, but somebody must keep it current and decide when a write is truly safe.
Choose who owns freshness and durability. Use the validated parameter controls or edit the JSON scenario, then select Load input to recompute the trace.
Compare cache-aside, write-through and write-back with LRU capacity and TTL. Lose invalidation to expose stale versions, or crash a write-back cache before dirty values flush.
Every visible outcome comes from the displayed state model. Timings, capacities and failures are illustrative assumptions, not cloud benchmarks or production-protocol guarantees.
Predict the next admission, delivery, cache, ownership or coordination decision. Introduce one failure at a time and account for every accepted, rejected, pending or committed outcome.
The player separates operation counters from architectural trade-offs. State size follows the active keys, tasks, nodes or retained history; the references use bounded scenarios. Container choices and presentation scans can affect simulator costs.
The four references implement the core model or its decision round. Queue/inbox and local ledger atomicity are explicit assumptions. Distributed deployment additionally needs durable shared state, complete protocol rules and operational validation. Reference inputs are fully validated/defaulted by the lesson; standalone callers must provide the shown fields.
Use when a measured reuse pattern justifies a cache and its invalidation, persistence and failure policy are explicit.
A hit rate alone says nothing about freshness or durability. Real write-through partial failures need an additional protocol.
Justify the model’s decision and name one production concern outside its scope.
MAKE IT STICK
Progress saves on this device and merges with your account after sign-in.
0 / 5000 · Saved on this device; synced when signed in.