SDI.
All Strategies
Application

Write-Around Cache

Writes go directly to the database, bypassing the cache entirely; data only enters the cache when it is subsequently read, avoiding cache pollution from write-heavy data that is rarely read.

Write-around caching sends all writes directly to the database without updating the cache. Data enters the cache only through the read path (cache-aside or read-through). This prevents cache pollution -- data that is written but never read does not waste cache memory. The trade-off is that any read immediately after a write will be a cache miss, adding latency. Write-around works best when data is written far more often than it is read.

Read/Write Pattern

Writes go directly to the database, bypassing the cache. Cache entries for written keys are invalidated. Data enters the cache only through the read path (cache-aside or read-through) when it is actually requested.

Consistency

Eventual consistency. With explicit invalidation on write, the inconsistency window is the time between the write and the next read (the cache is empty, not stale). With TTL-only invalidation, the cache may serve stale data for up to the full TTL duration.

Failure Mode

If the database fails, writes fail (there is no cache to absorb writes). If the cache fails, reads fall through to the database with higher latency. No data loss risk since writes always go to the database. The worst failure mode is a missed invalidation, causing the cache to serve stale data until TTL expiry.

Likely Follow-Up Questions

  • When would you choose write-around over write-through?
  • How does write-around prevent cache pollution, and why does that matter for cache hit ratios?
  • What happens if you forget to invalidate the cache entry on a write in a write-around pattern?
  • How would you handle read-after-write consistency with write-around?
  • Describe a system where write-around is the clear best choice for the write-side caching strategy.

Source: editorial — Synthesized from standard distributed systems caching literature and production engineering best practices.

Command Palette

Search for a command to run...