Tagged articles
lazy deletion
17 articles · Page 1 of 1
This article walks through a system design interview for a URL shortener, covering requirements analysis, capacity estimation (20K read QPS, 15TB storage), API design, NoSQL data modeling, key generation via auto-increment ID with base62 encoding, hash-based partitioning, Redis caching with LRU eviction, load balancing strategies, and lazy expiration cleanup.
Consistent HashingRedis cachingURL shortener
0 likes · 25 min read

The article explains how massive simultaneous expiration of Redis keys can overload the single‑threaded server, causing brief request blocking, response‑time spikes, and even memory‑related issues in master‑slave setups.
Eviction Policiescache expirationlazy deletion
0 likes · 6 min read

Redis uses both time‑based and lazy expiration, marking keys as expired at their TTL but only removing them on the next access or during periodic cleanup, so expired keys are not deleted the instant they expire.
JavaJedisKey Expiration
0 likes · 5 min read

This article details Redis's expiration mechanisms, comparing lazy (passive) deletion with periodic (active) deletion, and outlines the auxiliary memory eviction policies, highlighting their principles, pros, cons, and ideal use cases.
databaseexpirationlazy deletion
0 likes · 7 min read

This article explains Redis's two expiration mechanisms—periodic scanning with configurable frequency and lazy deletion on client access—detailing their configurations, execution steps, performance trade‑offs, and replication pitfalls to help developers manage memory efficiently.
databasesexpirationlazy deletion
0 likes · 5 min read

This article explains how to set key expiration times in Redis, the lazy and periodic deletion mechanisms for expired data, and the various memory eviction policies that Redis employs when the maxmemory limit is reached, providing a comprehensive guide for interview preparation.
eviction policyexpirationlazy deletion
0 likes · 5 min read

This article walks through building an EasyRedis service in Go, explaining Redis's lazy and timed expiration strategies, showing concrete code for on‑read expiration checks, and detailing a time‑wheel implementation that efficiently schedules key deletions.
GoKey Expirationbackend development
0 likes · 8 min read

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.
asynchronous deletedbGenericDeletedecrRefCount
0 likes · 16 min read

This article explains how Redis handles cache expiration using EXPIRE options, lazy deletion triggered by client access, and periodic cleanup tasks configured by the hz setting, while also covering implementation details, code examples, and the impact on memory management.
cache expirationlazy deletionperiodic deletion
0 likes · 9 min read

This article explains Redis's two expiration strategies—periodic active deletion and lazy deletion—detailing how the EXPIRE command works, the new NX/XX/GT/LT options introduced in version 7.0, the impact of unsynchronized clocks, and the underlying implementation code.
Active Expirationdatabaseexpiration
0 likes · 6 min read

This article explains the fundamental cache‑aside pattern, why lazy cache deletion is preferred over immediate updates, analyzes simple and complex cache‑database inconsistency scenarios, and proposes a high‑concurrency queue‑based solution with practical considerations for backend systems.
Cache AsideConsistencydistributed-systems
0 likes · 11 min read

The article explains Redis's two expiration key removal mechanisms—lazy deletion, which removes keys only when accessed, and periodic deletion, which randomly scans and deletes expired keys at regular intervals—detailing their concepts, pros, cons, and underlying source‑code implementations.
active expiredatabaseexpiration
0 likes · 4 min read

This article explains how Redis handles key expiration, detailing which commands clear or keep TTL, how PERSIST and RENAME affect expiration, the impact of negative or past timestamps, and the lazy and periodic deletion strategies Redis uses to manage expired keys efficiently.
TTLexpirationkey management
0 likes · 10 min read

This article explains the three Redis expiration‑key deletion strategies—timed, lazy, and periodic—their advantages and disadvantages, how Redis implements lazy and periodic deletion, and how persistence mechanisms such as RDB, AOF, and replication handle expired keys.
Deletion StrategyTimed Deletiondatabases
0 likes · 10 min read

This article explains how Redis manages key expiration using EXPIRE, PEXPIRE, EXPIREAT, and PEXPIREAT commands, details the internal expires dictionary, demonstrates code examples for setting, retrieving, and removing TTL, and discusses the lazy and periodic deletion strategies along with their impact on persistence and replication.
Key Deletiondatabaseexpiration
0 likes · 22 min read

This article explains Redis's expiration policies, detailing how commands like DEL, SET, INCR, LPUSH, PERSIST, RENAME, EXPIRE, and EXPIREAT affect key TTLs, and describes the lazy and periodic deletion mechanisms used by Redis to manage expired keys.
TTLcommandsexpiration
0 likes · 9 min read

Redis uses both lazy and periodic deletion strategies to remove expired keys, balancing CPU usage and memory efficiency, and these strategies also affect how persistence mechanisms like RDB and AOF as well as master‑slave replication handle expired keys.
Key ExpirationReplicationlazy deletion
0 likes · 3 min read
