Redis
Redis (Remote Dictionary Server) is an in-memory data store that holds its dataset in RAM for sub-millisecond access. Beyond simple key-value, Redis supports rich data structures including strings, hashes, lists, sets, sorted sets, streams, bitmaps, and HyperLogLog.
How it works
A Redis server accepts commands over a simple text protocol (RESP). Commands are executed single-threaded, which keeps semantics simple and operations on a single key atomic. Replication is asynchronous primary-replica by default; sharding is achieved via Redis Cluster, which partitions keys across nodes by hash slot. Persistence options include periodic RDB snapshots and an append-only file (AOF) with configurable flush policy.
Common use cases
- Caching. TTL-based eviction with millisecond reads.
- Session store. Centralized session state for horizontally scaled web applications.
- Rate limiting. Atomic increment with TTL backs token-bucket and sliding-window limiters.
- Queues and streams. Lists, sorted sets, and Streams cover work queues and log-style consumers with consumer groups.
- Pub/Sub. Lightweight fan-out messaging.
- Leaderboards and counters. Sorted sets and atomic counters support real-time leaderboards and analytics.
Origin
Created in 2009 by Salvatore Sanfilippo (antirez) and released under the BSD license. Redis Ltd. (formerly Redis Labs) stewards the project; the license was changed in 2024, which prompted forks including Valkey, backed by AWS and the Linux Foundation.
Caching, Memcached, Eviction Policy, TTL, Pub/Sub, In-memory Database, Valkey, Redis Cluster
Redis as Infrastructure: Caching, Coordination, and Scale