dbaplus Community
Oct 22, 2023 · Databases
How Redis Implements Lazy Deletion and When Expired Keys Stay Undeleted
This article explains Redis's two expiration mechanisms—lazy (access‑time) and periodic deletion—then dives into the source code of lookupKey, expireIfNeeded, deleteExpiredKeyAndPropagate, and the underlying delete functions, highlighting the differences between synchronous and asynchronous deletion, the conditions that prevent deletion of expired keys, and practical recommendations for configuring lazyfree.
Lazy DeletionMemory Managementasynchronous delete
0 likes · 16 min read
