← System Design learning path
System Design · Module 4 of 10

Caching

Speed up systems by storing frequent data.

📖 Key ideas

  1. Caches store frequently accessed data in fast storage.
  2. Layers: browser, CDN, application (Redis/Memcached), database cache.
  3. Strategies: cache-aside, write-through, write-back.
  4. Eviction policies: LRU, LFU, TTL.
  5. 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