TLDR Tech / Data
Cache Consistency: Strategies to Keep Data Fresh
Caches drift from three causes: TTL windows that outlast a database write, write ordering races, and multi-instance races where one server caches an old read as another commits a new write. Cache-aside handles reads lazily and tolerates staleness, write-through improves read consistency at the cost of synchronously writing to two systems, and event-driven invalidation through CDC handles changes that originate outside the app, with TTL retained as a backstop for missed events.
Read the full story