Effect Write-Behind Cache
Write coalescing with a journal so eventual durability is not data loss. Write-through pays the store on every keystroke (100 counter bumps, 100 store writes); naive write-behind buffers in memory and a crash between flushes silently drops every acknowledged write. This holds both ends: writes coalesce per key (100 bumps flush as one store write) but every accepted write is journaled first, and recovery replays the journal so a crash costs zero acknowledged writes. The demo proves 100x fewer writes than write-through and full recovery where the unjournaled buffer evaporates. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add https://ui.aryank.space/r/effect-write-behind-cache.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
Naive write-behind buffers writes in memory and flushes later. A crash between flushes drops every acknowledged write: the cache said OK, the store never heard.