← System Design learning pathSystem Design · Module 4 of 10
Caching
Speed up systems by storing frequent data.
📖 Key ideas
- Caches store frequently accessed data in fast storage.
- Layers: browser, CDN, application (Redis/Memcached), database cache.
- Strategies: cache-aside, write-through, write-back.
- Eviction policies: LRU, LFU, TTL.
- Cache invalidation is famously hard.
💡 Real-life example: A cache is keeping today's newspaper on the table instead of fetching it from the library each time.
CacheFast store of frequent data
Cache-asideApp checks cache, then DB
LRULeast Recently Used eviction
TTLTime to live for cached data