Grokking Redis
0% completed
3.5 Cache Stampedes
A product page key that is read 5,000 times per second expires, and its rebuild query takes 200 milliseconds. In those 200 milliseconds, about 5,000 x 0.2 = 1,000 requests miss the cache, and each one sends the same expensive query to the database. A cache exists to protect the database, and a stampede is the first of three situations where it does the opposite.
A stampede turns one expiry into hundreds or thousands of identical database queries. A hot key overloads one cache node while the others stay mostly idle
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%