Database Engineering
Caching
Cache-aside, read-through, write-through, write-behind; TTL, eviction, invalidation, stampedes and hot keys.
Caching Patterns
▶ interactive
Cache-aside, read-through, write-through and write-behind differ in who talks to whom and therefore in who is responsible for keeping the cache honest — and every one of them has a window where the cache is wrong.
Cache Invalidation, Stampedes and Hot Keys
▶ interactive
The hard part of caching is knowing when the cached value became wrong; the operational hazards are stampedes when many keys expire together and hot keys when one key gets a disproportionate share of traffic.