Redis: Data Structures, Persistence, Eviction, High Availability, and Operational Pitfalls
Context: You are designing a latency-critical backend that relies on Redis both as a cache and as a data store. Explain the following topics to demonstrate practical, production-oriented understanding.
-
Core data structures
-
Strings, Lists, Sets, Sorted Sets (ZSET), Hashes, Streams
-
Typical time and space characteristics
-
Persistence mechanisms
-
Compare RDB and AOF: durability, performance, recovery trade-offs
-
Memory pressure
-
Eviction policies and TTL behavior under memory pressure
-
High availability and scaling
-
Replication, Sentinel failover, and Cluster sharding
-
Programmatic semantics
-
Transactions, Lua scripting
-
Distributed locks
-
Pitfalls (e.g., clock skew, process pauses, network partitions) and fencing tokens
-
Cache reliability at scale
-
Strategies to prevent cache stampede and handle hotspot keys