Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Engram

A Redis-compatible in-memory cache written in Rust. It speaks RESP2, runs on Tokio’s current_thread runtime, and treats Redis 7.2.4 as the compatibility oracle. Valkey is the only permitted secondary reference.

Engram is a cache server, not a Redis replacement. Replication, pub/sub, Lua, cluster, streams, and RESP3 are out of scope for now.

Status

Implemented against Redis 7.2.4:

  • Strings with expiry (SET options, GETEX/GETDEL, MSET, ranges, INCR)
  • Hashes, lists/queues, sets, and non-lexicographic sorted sets
  • Blocking list/zset pops with FIFO waiter order
  • KEYS / SCAN (cursors are opaque; they need not match Redis)
  • MULTI / EXEC / DISCARD / WATCH / UNWATCH
  • RDB v11 persistence (SAVE; BGSAVE is currently synchronous)

SELECT accepts database 0 only. Lexicographic zset commands are not implemented.

Run

Requires Rust 1.85+.

cargo build --offline
target/debug/engram --bind 127.0.0.1 --port 6379

--dir and --dbfilename select the RDB file (default ./dump.rdb). On startup Engram loads that file if it exists.

Verify

The differential harness compares Engram to a local Redis 7.2.4 build. Clone and compile it once:

git clone --branch 7.2.4 --depth 1 https://github.com/redis/redis.git redis-reference
make -C redis-reference
make verify

make verify runs unit tests, then redis-compare: it starts Engram and redis-reference/src/redis-server, sends identical commands to both, and fails on any deterministic RESP2 difference. The harness also covers blocking pops, transactions, redis-benchmark, and bidirectional RDB v11 load/save.

Layout

crates/engram/           server
crates/redis-compare/    live differential verifier

redis-reference/ is a local Redis 7.2.4 checkout used only for verification. It is not part of this repository.

License

MIT. See LICENSE.

About

Redis-compatible in-memory cache in Rust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages