Skip to content

Redis

C

In-memory data structure store used as a database, cache, message broker, and streaming engine.

74k stars RSALv2 / SSPLv1 / AGPLv3 View on GitHub
Start the Grand Tour
Salvatore Sanfilippo Creator @antirez

Creator of Redis. Sicilian programmer and security researcher, previously known for creating the Idle Scan TCP technique and hping. Built the first Redis prototype while working on LLOOGG, a real-time analytics product at his company Merzia. Stepped back as BDFL in June 2020, rejoined Redis Inc. in November 2024.

Yossi Gottlieb Core maintainer @yossigo

Current lead maintainer. Took over day-to-day technical leadership from antirez in 2020. Focused on reliability and the cluster subsystem.

Oran Agra Core maintainer @oranagra

Co-maintainer alongside Gottlieb. Works on security hardening and the replication system.

Event loop (ae.c). A single thread drives everything. aeMain() loops continuously, calling aeProcessEvents() to dispatch I/O events via epoll (Linux) or kqueue (macOS/BSD). No threads means no locks on the hot path — commands execute serially, which makes behavior predictable and the source code traceable without needing to follow concurrent execution.

Data structures. Redis exposes data types — strings, lists, hashes, sets, sorted sets, streams — rather than raw byte values. Internally, each type uses one or more compact representations: dict (a hash table with incremental rehashing), listpack (a tightly packed byte array for small collections), and skiplist (a probabilistic linked structure for sorted sets). The choice of representation switches automatically based on element count and size thresholds.

Persistence: RDB + AOF. Redis forks the process to write a point-in-time snapshot (RDB) — the child writes, the parent continues serving commands using copy-on-write memory pages. The append-only file (AOF) records every write command for finer-grained durability. Both mechanisms can run simultaneously. The tradeoffs between them are explicit and documented in the configuration.

Replication and cluster. Replicas connect to a primary and receive a stream of commands after an initial full sync. Cluster mode shards the keyspace across 16,384 hash slots distributed across nodes, with each node aware of the full slot map.

Origin Story Read how Redis came to be and the decisions that shaped its architecture.

Keyboard Shortcuts