Caching Patterns, Eviction & Redis/Memcached

Why and where to cache, read/write patterns, eviction policies (with an LRU implementation), Redis data structures, persistence and Cluster, Memcached, and multi-level caches.

About 85 minutes · 15 exam questions · 8 interview questions · 2 code labs

What you will learn

  1. Why cache: latency, load and the hit-ratio math
  2. Where to cache: the layers
  3. Read patterns: cache-aside and read-through
  4. Write patterns: write-through, write-back, write-around
  5. Eviction policies and an O(1) LRU implementation
  6. Redis: data structures, threading and persistence
  7. Redis Cluster, replication and hash tags
  8. Redis vs Memcached
  9. Local vs distributed vs multi-level (L1/L2) caches and serialization cost
  10. Scenario: “The database is getting slow — introduce caching”

Next: Cache Invalidation, Consistency & Failure Modes