advanced
Write-through
Write data to cache and backing store together when read freshness matters enough to pay write latency.
Write-through updates cache and backing store synchronously on every write so subsequent reads hit fresh cache entries. Read latency stays low after writes at the cost of higher write latency and coupling to cache availability.
Use when read freshness after write is critical and write volume is moderate. Cache and database failures need coordinated handling — dual writes can diverge without transactions.
On interviews: contrast write-through with cache-aside for a product catalog, state write latency impact, and failure scenarios.
Common pitfalls: write-through to cache only without durable store confirmation; cache size exceeding memory with full dataset; ignoring partial write failures.
Checklist:
- Confirm sync write to cache and store.
- Measure added write latency.
- Handle cache or DB partial failures.
- Size cache for expected hot set, not all data.