Redis Deep Dive
Difficulty: Medium | Topic #18
What to Learn
Data structures (strings, hashes, sorted sets, lists, sets, bitmaps, HyperLogLog), TTL-based expiry, pub-sub, Lua scripts for atomicity, persistence (RDB vs AOF), Redis Cluster vs Sentinel.
Resources
- Hello Interview: Redis Deep Dive ↗
- ByteByteGo: Why is Single-Threaded Redis So Fast? ↗
- Hussein Nasser: Redis Pub-Sub vs Kafka ↗
Covered by Problems
| Problem | Difficulty | Link |
|---|---|---|
| Rate Limiter | Medium | → |
| Distributed Cache | Medium | → |
| Social News Feed (FB News Feed) | Medium | → |
| Top K System | Hard | → |
Key Concepts to Master
- Sorted sets for leaderboards and time-series data
- HyperLogLog for approximate unique counts at low memory
- Pub-sub for real-time messaging (and its fire-and-forget limitation)
- RDB snapshots vs AOF logging for durability
- Redis Cluster hash slots and why keys with the same slot must use hash tags