Skip to content
Ameen Abozaid
Planned lessonMID-040-L03

Hot keys

  • Lesson 3 of 5
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

detect and mitigate a key that takes a disproportionate share of traffic.

Planned topics

  • A hot key: one product during a flash sale. A Redis node (or one instance) serving it becomes the bottleneck.
  • Detect: per-key access counts, redis-cli --hotkeys (needs an LFU policy; verify), or metrics from the client.
  • Mitigate: local L1 cache with short TTL in each instance, replicate the key under several names (product:7#1..#4) and read at random, or serve through CDN.
  • Combine with stampede protection: a hot key expiring is the worst case.
Draft outline details

Demonstration

read path: Caffeine (2 s TTL) → Redis → database, so 20 instances send at most 10 requests per 20 s to Redis for that key.

Check your understanding

How does a short-lived local cache help with a hot key?

Show answer

Most reads never reach Redis.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.