Storage, Redis & Caching
Redis data types
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.
What you will be able to do
- Choose a Redis data type from the operations a key needs, such as single-field updates.
- Check a key's type and encoding before changing the value it holds.
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
- Object lifecycle policiesIntermediate · 4 min
Explain how S3 lifecycle rules transition and expire objects by age, and why a rule added without a retention owner can delete records that must be kept.
- 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 eviction policiesAdvanced · 4 min
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.
- 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.