Why partition the cache differently from the database?
If cache and database shard identically, losing one cache cluster sends all of its misses to the same database shard, creating a hot spot. A different partitioning scheme spreads one cache cluster's misses across many database shards, so the failure is absorbed, not concentrated.
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?
- How does change data capture keep a cache correct?
- Why use add instead of set when warming a cache?
- 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.