Q28 Redis Domain 2 · 25–30% of exam Priority · Real Exam Choose 2

Which TWO practices prevent a cache stampede when a popular key expires?

  1. A Add a small random jitter to each key's TTL (correct answer)
  2. B Recompute the value behind a short-lived lock so only one caller rebuilds it (correct answer)
  3. C Set all TTLs to the same value for predictability
  4. D Disable eviction
  5. E Use the KEYS command to pre-warm

Shortcut: Identical TTLs cause many keys to expire together and every caller to rebuild at once. Jitter spreads the expiries, and a rebuild lock ensures a single caller recomputes while the others wait or serve stale. KEYS is O(N) and blocks the server, making the incident worse.