3 ms·
To me, cache invalidation is not strictly about either replacing or removing cache entries. Rather, cache invalidation is the process of determining which cach
by cluckindan 1y ago
To me, cache invalidation is not strictly about either replacing or removing cache entries.
Rather, cache invalidation is the process of determining which cache entries are stale and need to be replaced/removed.
It gets hairy when determining that depends on users, user group memberships AND per-user permissions, access TTL, multiple types of timestamps and/or revision numbering, and especially when the cache entries are composite as in contain data from multiple database entities, where some are e.g. representing a hierarchy and may not even have direct entity relationships with the cached data.
- kragen 1y agoYes—and, in many cases, ensuring that you don't use entries which become outdated during your computation.
- cluckindan 1y agoA bit of TOCTOU sprinkled in the cache integration ensures a fun day at the races!
- kragen 1y agoTOCTOU bugs are a subset of cache invalidation bugs.
- cluckindan 1y agoAre they really? TOCTOU is a trigger for race conditions, but I guess the result of the check is a cached value. Then again, the issue in TOCTOU is that the ”cached value” is not invalidated at all, or inadequately. It doesn’t really have anything to do with the invalidation mechanism, it is downstream from it.
- kragen 1y agoI think it's sort of subjective. The fact that the invalidation mechanism doesn't extend further downstream is a problem with it, from my point of view, but maybe not yours. It's difficult to provide indisputable proofs of such value judgments.