PeaDB
An in-memory data store that speaks the Redis protocol. Existing Redis clients and tools connect without changes.
redis-cli -p 6379
127.0.0.1:6379> SET hello world
OK
127.0.0.1:6379> GET hello
"world"What PeaDB is
PeaDB aims to behave exactly like Redis 7.2.5: the same protocol, the same commands, and the same edge cases. It is built on cache-friendly data structures and a lean event loop.
The command path is single-threaded today, like Redis. A sharded, multi-core design is the target on the roadmap.
Run PeaDB
Run the published Docker image:
docker run -d --name peadb -p 6379:6379 -v peadb-data:/data alsatianco/peadb-server:latest \
--port 6379 --bind 0.0.0.0 --dir /data --appendonly yes --requirepass "<your-password>"
Protected mode is on by default, so set a password with --requirepass. The image does not save data unless you turn on --appendonly yes or --save.
Or build it from source. You need a C++20 compiler (GCC 11 or newer, or Clang 14 or newer) and CMake 3.16 or newer:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
./build/peadb-server --port 6379 --bind 127.0.0.1
Read the quick start for details.
What works today
- Full RESP2 and partial RESP3 protocol, so existing Redis clients work with no changes.
- Strings, hashes, lists, sets, sorted sets, streams, HyperLogLog, geo, bitmaps, pub/sub, transactions, and Lua scripting. See the full command list.
- RDB snapshots and AOF logging. RDB files use the Redis format, so Redis and PeaDB can load each other's files.
maxmemorywith all eight eviction policies.- PSYNC2 replication with several replicas, chained replicas, and automatic reconnect.
Speed
Single-connection throughput. These numbers are representative, not peak:
| Operation | Operations per second |
|---|---|
| SET | 63,694 |
| GET | 59,524 |
| LPUSH | 62,893 |
| LPOP | 61,728 |
| INCR | 63,694 |
| SADD | 63,694 |
Throughput is competitive at low concurrency. Tail latency rises under very high concurrency, because the command path is single-threaded. You can reproduce the numbers with scripts/dev/redis_vs_peadb_benchmark.sh, which compares PeaDB with Redis.
Known limits
- No TLS, no multi-user ACL, and no Sentinel. Read the security notes before you deploy.
- Cluster mode is experimental and not safe for production. It can write keys on the wrong node, and
redis-cli --clusterworkflows do not work. - Lua is stock Lua 5.1.5, not the patched copy inside Redis, so some script results differ.
Every known difference from Redis is listed in compat/delta.md.