How does change data capture keep a cache correct?
A service reads the database's change log and invalidates or updates the matching cache entries whenever a row changes. Because it follows the database's own record of writes, it catches changes from every writer, not just the application code that remembered to clear the cache.
Answered in
Caches That Survive Change: Warming, CDC Invalidation and Partitioning Apart From the DatabaseResizing a cache, replacing a node or failing over a region causes cold starts. How warming, log-driven invalidation and separate partitioning prevent them.
Read the full analysisOther questions this article answers
More system design & architecture questions
- What is a Backend for Frontend?
- What is the main risk of the BFF pattern?
- What is a value-added service layer?
- What does a field mask do in an API?
- What is a cold cache problem?
- Why use add instead of set when warming a cache?
- Why partition the cache differently from the database?
- Why must a chat system store a message before confirming it?
Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.