/plushcap/analysis/redis/redis-caches-promises-locks

Caches, Promises and Locks

What's this blog post about?

Instagram's engineering blog recently discussed the concept of promisifying cached values to prevent cache misses from causing stampedes on underlying DBMS. The idea is to store a dummy value (promise) in the cache, signaling to competing requesters that someone else is preparing the data, prompting them to wait instead of overwhelming the DBMS. This concept is not new and can be achieved using Redis features like key expiration, atomic operations, and Pub/Sub. The author has implemented this approach as Redis MemoLock, which primarily relies on these three Redis features. The implementation includes a simple example in Go language and aims to provide more benefits than typically offered with read/write-through caches.

Company
Redis

Date published
May 29, 2019

Author(s)
Redis

Word count
851

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.