An in-memory key-value cache spread across many nodes, for fast reads and reduced load on the data store.
- Fast get and set by key.
- Scale beyond one machine's memory.
- Handle node failures without losing the whole cache.
- An eviction policy when memory is full.
- Partitioning: spread keys across nodes with consistent hashing so adding or removing a node moves few keys.
- Replication: replicate each shard so a node failure does not lose its data (see replication).
- Eviction: LRU is the common default; also support TTL expiry.
- Consistency: caches are usually best-effort, so plan invalidation (see caching) and accept brief staleness.
flowchart LR
Client --> Router{Consistent Hashing}
Router --> N1[(Cache Node 1)]
Router --> N2[(Cache Node 2)]
Router --> N3[(Cache Node 3)]
- Read more (free): Ultimate Guide to Redis in System Design
- Quick, focused prep: System Design Interview Crash Course
- Full course: Grokking the System Design Interview