surrogate key
An extra label attached to cached items, such as product-42 or shop, so that every item with that label can be purged in one go.
In more detail
Pages and responses are tagged with the entities they contain. When product 42 changes, purging its tag removes exactly the affected entries and leaves the rest of the cache untouched.
Related terms
- cache invalidation — Marking cached copies as out of date, or deleting them, when the real data changes so the next read fetches fresh data.
- two-tier cache — A cache with a small, very fast local layer inside each server process (L1) in front of a larger shared layer such as Redis (L2).
Taught in
- Distributed Cache Invalidation: Redis & Tagged Purging — Production Full-Stack Engineering