Storage, Redis & Caching
Redis eviction policies
Explain how Redis eviction policies choose what to remove at the memory cap, and why a single instance shared by cache and session data can lose the wrong keys.
What you will be able to do
- Read the eviction policy, the eviction counters and the hit ratio on a test instance.
- Decide which workloads need separate instances with different policies.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Storage, Redis & Caching
- Multipart uploadsAdvanced · 4 min
Explain how multipart upload builds one object from numbered parts, and why unfinished uploads keep costing money until they are completed or aborted, even when they do…
- Redis data typesAdvanced · 4 min
Explain how Redis data types set the cost of each change and the memory a key uses, and why one JSON string per session is a poor fit for small updates.
- TTL and stampedesAdvanced · 4 min
Explain how TTLs cause cache stampedes when keys expire together, and use jitter and a short rebuild lock to keep the database from taking the spike.
- Cache asideAdvanced · 4 min
Explain how cache-aside reads and writes can return stale data after a database change, and how deleting the cached key after the commit fixes most cases.
- Write through cachingAdvanced · 4 min
Explain write-through caching, where each write updates the cache, and why a failed cache write after a database commit leaves the two stores disagreeing silently.
- Cache invalidationAdvanced · 4 min
Explain how cache invalidation works through deletes, versioned keys and TTLs, and why a fact cached under many keys needs a dependency index to clear all of them.