Caches, Promises and Locks
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
Language
English
Hacker News points
None found.