Redis Deep Dive
Redis is the dominant distributed cache. It is an in-memory data store that supports strings, hashes, lists, sets, sorted sets, bitmaps, and more — far beyond simple key-value caching. Operations complete in sub-millisecond time because everything lives in RAM. Persistence options matter for production. RDB (Redis Database) takes point-in-time snapshots at intervals — fast recovery, but you may lose data since the last snapshot. AOF (Append Only File) logs every write operation — more durable, slower recovery. Most teams use both: RDB for fast restarts, AOF for durability. Redis Pub/Sub enables real-time messaging between services — useful for cache invalidation broadcasts. For caching specifically, strings with SETEX (set with expiry) and hashes for structured objects are the most common patterns.