Order the steps
Order the race that leaves a stale value in the cache.
- Writer deletes the cache key
- Writer commits the new row
- Reader misses the cache and reads the old row
- Reader stores its old value in the cache
Choose an answer, then open Show answer below to check it.
Show answer
Answer: C B A D
- Reader misses the cache and reads the old row It now holds the old value in memory.
- Writer commits the new row Database is updated.
- Writer deletes the cache key The cache is empty.
- Reader stores its old value in the cache Stale until the TTL expires.