Home▸Computer Science▸Normalized vs Denormalized State: Cache Drift Simulator

Normalized vs Denormalized State: Cache Drift Simulator (2D)

A 2D top-down companion simulator of client-side state normalization: dispatch updates to a single canonical entity and watch denormalized per-screen copies drift out of sync while a normalized single-source-of-truth store stays perfectly consistent, with adjustable dispatch rate, screen count and sync propagation delay.

Computer Science2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-mobile-state-management ↗ Open standalone

A top-down 2D companion to the cache-drift simulator: a single tracked entity — a "Post" with a like count — sits in a canonical store at the center, while two to eight screens sit around it. In denormalized mode each screen caches its own copy, and dispatching an update only refreshes the screen that actually re-read the data, leaving the others drifting out of sync with a growing staleness age. Switch to normalized mode and every screen instead references the one canonical record, so an update reaches all of them once the sync propagation delay elapses and the consistency readout returns to 100%. An adjustable auto-dispatch rate drives updates continuously instead of one click at a time, and an "auto-resync on read" toggle shows the usual workaround — periodic refetching — and why it narrows the staleness window without ever closing it.

⚙ Under the hood

A top-down 2D view of a canonical store and its observing screens, where dispatched updates keep normalized screens consistent but leave denormalized screen copies drifting out of sync until they are re-read.

state managementnormalizationcacheconsistencyreduxmobile2dcomputer science

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)