Skip to main content
system design course

Caching

Why a database slows down under load, and how a copy in memory fixes it without lying to your users.

8 chapters33 lessonsabout 1 hour
0 of 33 lessons readStart the course
  1. Start here. What a cache is, why a database needs one, and where one can live.

    1. The Problem a Cache Solves2 min
    2. What a Cache Is3 min
    3. Where Caches Live3 min
    4. Reading From a Cache2 min
    5. Writing Through a Cache2 min
    6. How Caches Fail3 min
  2. The two places a copy can sit that are faster than Redis, and harder to correct.

    1. Client-Side Caching2 min
    2. In-Process Caching2 min
  3. How the application reads data, from cache first, or transparently.

    1. Cache-Aside3 min
    2. Read-Through3 min
    3. What a Hit Rate Actually Buys You2 min
    4. Staleness and TTLs2 min
  4. How and when writes propagate from cache to the database.

    1. Write-Through2 min
    2. Write-Behind2 min
    3. Write-Around3 min
    4. Cache Consistency2 min
    5. Picking a Combination3 min
  5. What gets removed when cache is full, and how to handle mass expiry.

    1. Eviction Policies2 min
    2. LFU: Counting Instead of Timing2 min
    3. FIFO, Random, and Why Nobody Picks Them2 min
    4. The Stampede Problem2 min
    5. Locks, Jitter, and Early Refresh3 min
    6. Hot Keys2 min
    7. Negative Caching3 min
  6. In-memory data structure store powering caches, queues, leaderboards, and pub/sub.

    1. Why Redis Is Fast3 min
    2. Data Structures Beyond Strings3 min
    3. Persistence: RDB and AOF3 min
    4. Replication, Sentinel, and Cluster3 min
  7. Cache static assets at edge servers close to users worldwide.

    1. How a CDN Works3 min
    2. Cache Keys and Invalidation3 min
    3. Static vs Dynamic Content2 min
    4. Edge Compute3 min
  8. Finish here. Earning the cache, placing it, and saying what it breaks before you are asked.

    1. Caching in an Interview3 min