<b>This week in caching: stopping the stampede</b>
What happens when a hot key expires and a thousand requests rebuild it at once. Roundup:
— <i>Probabilistic early expiration (XFetch)</i> — the Vargas algorithm that recomputes a value slightly before TTL based on how long the last build took; the cleanest math on dogpile prevention.
— <i>Locking vs leasing</i> — memcached's lease tokens compared to Redis SETNX locks, with the deadlock failure mode of naive locks.
— <i>Why a tiny TTL jitter beats a fixed TTL</i> — adding random seconds so 100k keys don't all expire on the same second.
Credits to the original RedisLabs and Facebook memcache papers.
Bookmark: the XFetch explainer — once you see the formula you can't unsee how many sites need it.
Cache Catch
@CacheCatch
<b>This week in caching: stopping the stampede</b>
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.