System Design Space
Knowledge graphSettings

Updated: May 7, 2026 at 6:26 PM

Caching Strategies: Cache-Aside, Read-Through, Write-Through, Write-Back

medium

Practical guide to Cache-Aside, Read-Through, Write-Through, and Write-Back: how to choose a strategy by freshness requirements, invalidation model, and cache failure behavior.

Caching almost always buys speed at the price of staleness, invalidation complexity, and a more fragile operating loop.

The chapter compares Cache-Aside, Read-Through, Write-Through, and Write-Back through freshness requirements, miss behavior, write cost, and failure risk.

In architecture conversations, that helps you discuss cache placement, acceptable staleness, and operational failure modes as real design choices rather than the automatic move of 'let's add Redis.'

Practical value of this chapter

Cache as Contract

Treat cache policy as a product contract: define where stale reads are acceptable and where strict freshness is required.

Invalidation

Choose invalidation by business semantics: synchronous updates, event-driven invalidation, TTL, or hybrid versioning.

Stampede Protection

Prevent stampede with TTL jitter, single-flight, background refresh, and controlled origin fan-out.

Interview Framing

Demonstrate you understand not only read acceleration, but also consistency impact and operational risks.

Pattern

Cache-Aside Pattern

Canonical reference for cache-aside and the trade-offs that matter in production.

Open reference

Choosing a caching strategy is really about deciding where freshness matters, what should happen on a miss, and how much operational complexity you are willing to carry in production.

Cache-Aside, Read-Through, Write-Through, and Write-Back solve different problems: some keep the read path simpler, some make read-after-write more predictable, and some trade stronger write guarantees for much cheaper writes.

Before choosing, define where the source of truth lives, how invalidation works, what cache hit rate is good enough, how TTL should be set, and how you will prevent miss storms during expiry waves or failures.

Four Core Strategies

Cache-Aside

The application controls cache reads and loads data from DB on misses.

Read Path

App

read(key)

Cache

GET key

DB

SELECT on miss

Cache

SET key

App

return value

Write Path

App

update(key)

DB

WRITE source of truth

Cache

invalidate/update key

App

ack

What happens

  • Reads go to cache first; on a miss, data is loaded from DB.
  • After a miss, the app warms cache for subsequent requests.
  • Writes go to DB first, then cache is invalidated/updated to control stale data.

Risk: Invalidation is critical; weak invalidation quickly increases stale-read rate.

How to Choose a Strategy

StrategyRead latencyWrite latencyConsistencyComplexityBest fit
Cache-AsideLow on a hit, higher on a missLow: the database is updated separately from cacheDepends on how quickly invalidation propagatesLow / mediumGeneral read-heavy scenarios
Read-ThroughStable because the cache layer loads data itselfDepends on the chosen write policyDepends on how the write path is designedMediumShared infrastructure cache layers
Write-ThroughLowHigher: cache and database are updated synchronouslyHigh after successful writeMedium / highFlows where read-after-write matters
Write-BackLow for already warmed dataVery low for the clientDeferred, with stronger durability requirementsHighWrite-heavy flows with batch flush

Practical Guidance

What to do

  • Start by defining where stale data is acceptable and where reads must immediately reflect writes.
  • Treat invalidation and eviction as separate design problems, not as afterthoughts.
  • For Write-Back, rely on durable buffering and idempotent flush behavior.
  • Add miss-storm protection: request coalescing, small TTL variance, and background refresh for hot keys.

Common mistakes

  • Caching without a clear invalidation strategy and lifetime policy.
  • Using Write-Back for critical financial data without a durable journal or queue.
  • Trying to cache everything instead of focusing on expensive reads and hot keys.
  • Leaving the system unprotected against large miss storms and request collapse.
  • Ignoring cache hit rate, p95/p99, and how often stale data is served.

Checks Before Rollout

1. Measure baseline p95/p99 and cache hit rate before rollout.
2. Define the source of truth and the invalidation model.
3. Constrain key size and plan namespaces and versioning.
4. Prepare fallback behavior for cache degradation or complete outage.

Short selection rule: if predictability and simplicity matter most, start with Cache-Aside; if strict read-after-write matters, look toward Write-Through; if the main bottleneck is the write path and deferred consistency is acceptable, choose Write-Back with a reliable flush pipeline.

Caching strategy should be driven by freshness requirements, not by team habit.

Related chapters

Enable tracking in Settings