3 ms·
Cache invalidation is not about effectively caching immutable values (where FIFO or least recently used may be valid solutions) but about the problem of caching
by PeterisP 7y ago
Cache invalidation is not about effectively caching immutable values (where FIFO or least recently used may be valid solutions) but about the problem of caching mutable values, the hard part is ensuring correctness without having to clear all caches everywhere whenever something changes.
Properly ensuring that when a value changes (and thus any cached copies become invalid) then every place where that value might be cached properly and timely invalidates [that part] of the cache, because otherwise other parts of the system will see stale/wrong/conflicting data which generally results in 'fun'. And it appears everywhere from memory reads in a single multicore processor (where one core might change a variable that the other core has cached) to globally distributed data storage systems with eventual consistency to state shown on the user's screen as the underlying data is getting mutated by someone/something else.