What is a write-around cache strategy?
Write-around caching is a strategy in which write operations bypass the cache entirely and go directly to the persistent storage (database, object store). The cache is only populated on cache miss during a subsequent read. This contrasts with write-through (cache and storage updated synchronously on every write) and write-back (cache updated immediately, storage updated asynchronously).
**How it works**: On a write, the application writes directly to the backing store, leaving the cache untouched. If a cached entry for the same key exists, it is either left stale (to expire via TTL) or explicitly invalidated. On a subsequent read, a cache miss triggers a read from storage and a cache population.
**When to use it**: Write-around is optimal when written data is unlikely to be re-read in the near term. Classic use cases include: - **Log ingestion and analytics**: Log records are written once and read rarely or in bulk aggregate queries, not individually. - **Bulk imports / batch ETL**: Large volumes of data loaded into a database that won't be queried immediately don't benefit from cache population—they would evict hot entries. - **Media upload pipelines**: A newly uploaded video or image is written to object storage but rarely fetched in the seconds after upload.
**Advantages**: Prevents cache pollution—the cache is not filled with cold data that will never be re-read, preserving cache space for frequently-accessed data. Reduces write latency compared to write-through (only one write, to storage, not two).
**Disadvantages**: First reads after a write incur a cache miss penalty. If the same data is frequently read shortly after write (e.g., a user reading back a record they just created), write-around causes unnecessary latency. In those cases, write-through or application-level cache population on write is preferable.
**Comparison with write-through**: Write-through keeps the cache always warm for recently written data at the cost of double-write overhead. Write-around is cheaper on write but cold on immediate re-read. The choice depends on the read-after-write access pattern.
A hybrid approach: use write-around for bulk/background writes, but explicitly populate the cache for user-facing writes where read-after-write is the dominant pattern.
Defines write-around correctly (writes bypass cache, go to storage), names two appropriate use cases, and contrasts it with write-through.
Covers definition, use cases, advantages (cache pollution prevention), disadvantages (cold first read), and discusses when to prefer write-through or a hybrid approach.
Reading the answer is step one. Explaining it unprompted — under interview pressure — is what actually matters. Get AI-graded feedback on your answer with follow-up probes on your weak points.
Get Graded — Free Assessment