Imagine we're building an e-commerce application.
We use Redis to cache product details so that our application doesn't have to query the database every time someone opens a product page.
Everything works well until one product suddenly goes viral.
A product that normally receives 1,000 requests per second now receives 100,000 requests per second.
Our Redis cluster has multiple nodes. Some of them are barely doing any work. Yet one node is struggling to keep up.
Why?
The answer lies in a concept called hot keys .
In this article, we'll understand how Redis distributes keys, why a single key can become a bottleneck, and how we can distribute the load without simply adding more Redis nodes.
1.β¦