Skip to content
System Designadvanced40 minPremium

Caching strategies

Read-through, write-behind, invalidation and the failure modes each one buys.

Share

In short

A cache is a bet that reading stale data is cheaper than reading correct data. The strategies differ in who writes to the cache, when, and what happens when the cache and the source disagree. Cache-aside is the default because it fails safely. Write-behind is the fastest and loses data on a crash. Almost every production incident involving a cache comes down to invalidation, stampedes, or a cache that was quietly doing nothing at all.

Contents

  1. 01The four strategiesCache-aside, read-through, write-through and write-behind compared.
  2. 02Invalidation and stampedesTTLs, explicit invalidation, and what happens when a hot key expires.

Downloads

Caching decision matrix PDF · 310 KB

This is a premium topic

The summary and the first page are free. Unlock the rest, plus the downloadable references.

  • #caching
  • #performance
  • #consistency
  • #redis