Grokking Redis
0% completed
3.3 TTL Jitter and Early Expiration
One million cache keys written by a batch job with a fixed 600-second TTL all expire within the same second, ten minutes later. If each miss costs one database query, the database receives up to a million queries at once instead of the steady trickle it normally sees. A TTL is the simplest freshness tool a cache has, but used naively it causes two failures: data stays stale until the timer fires, and entries that expire together send a sudden burst of load to the database.
This lesson covers two techniques that fix the second failure: jitter and probabilistic early expiration
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%