Caching · Flashcard

Even with delete-on-write, cache-aside can end up caching a stale value. How, and what bounds the damage?

hard Consistency

Answer

A reader misses and reads the old value from the database; a writer then updates the database and deletes the key; finally the reader writes its old value into the cache. It stays stale until the TTL. Fixes: a short TTL as a bound, or leases (as in Facebook's memcache) that reject a set after the key was deleted.

Review this in your daily deck All cards in Caching