Learn Labs
Application Patterns

Self-test

Check your understanding

Self-test12 questions

—/12
  1. Walk through a cache-aside read and write. Why prefer deleting the cache key over setting the new value on write?

  2. Describe the race that can leave a stale value in the cache even with delete-on-write. What bounds it?

  3. What's a cache stampede? Give three defences.

  4. What's cache penetration, and how do you stop it?

  5. Why does a fixed-window rate limiter allow up to twice the limit? Which algorithm fixes it most cheaply?

  6. Why must a token bucket's refill-and-take run as a Lua script?

  7. Should a rate limiter fail open or fail closed when Redis is down? Give a case for each.

  8. Why is DEL the wrong way to release a lock? What's the right way?

  9. What problem do fencing tokens solve that a perfect lock release doesn't?

  10. Summarise the Redlock debate. When is a single-instance Redis lock good enough?

  11. Why use GETDEL when flushing counters to a database?

  12. Design question

    Design the Redis side of a URL shortener: redirects cached, per-user rate limits on creating links, real-time click counts, and daily unique visitors per link.