stale read
A read that returns an older value than the latest committed write.
In more detail
In caching, the classic case is a reader that misses, reads version one, pauses, and caches it after a writer committed version two and deleted the key. Every step was correct and the result is wrong. Versioned keys, write through or a short TTL bound it.
Related terms
- staleness — How out of date a copy of data is compared with the latest write.
- cache invalidation — Marking cached copies as out of date, or deleting them, when the real data changes so the next read fetches fresh data.
- versioned key — A cache key that includes the data's version, so a write simply moves readers to a new key.
- race condition — A bug whose outcome depends on the timing of two things happening at once.
Taught in
- Replication, Failover And Leader Election — Scalable System Design & Distributed Architecture
- Eventual Consistency And What It Costs A Product — Scalable System Design & Distributed Architecture
- Cache Invalidation And The Three Hard Cases — Scalable System Design & Distributed Architecture