Pattern
Write-around cache
Problem
Cache-aside with writes populating the cache can pollute the cache with never-read data (write-heavy but read-rare content).
Context
You write a lot of data that may or may not be read soon (bulk imports, log ingestion). Populating cache on every write wastes memory.
Solution
Writes bypass the cache and go directly to the DB. Reads use cache-aside (check cache, miss → read DB → populate cache). Only actually-read data ends up in the cache.
Trade-offs
- First read after a write pays a cache miss (guaranteed)
- Cache stays 'clean' — only holds hot data
- Applications must be careful that stale cache entries get invalidated on write (unless TTL is short)
Failure modes
- Cache holds stale data indefinitely if invalidation is forgotten
- Bulk writes bypass any cache-based rate limiting
When to use
- Bulk write / rare read patterns
- Data with very selective read patterns
When NOT to use
- Write-then-immediately-read patterns