A lightweight, embeddable Redis-style key-value store written in C++.
No daemon, no configuration, no external dependencies — just drop it into your app and go.
LiteRedis is designed for developers who love Redis-style data access but don’t want to spin up a server for every project. Whether you're building a CLI tool, an offline desktop app, or prototyping fast logic, LiteRedis gives you:
- In-memory storage with Redis-like semantics
- TTL (time-to-live) support for expiring keys
- Optional snapshot-based persistence
- Simple C++ API or command-line interface
- Zero configuration, embeddable as a library
- Terminal-based productivity apps (CRM, note trackers, offline task managers)
- Local development tools needing fast state/caching
- Embedded systems where Redis is overkill
- Educational tools for learning database internals
| Feature | Redis Server | SQLite | RocksDB | LMDB | LiteRedis |
|---|---|---|---|---|---|
| Embeddable | ❌ Daemon | ✅ | ✅ | ✅ | ✅ ✅ ✅ |
| In-Memory Mode | ✅ | ✅ | ✅ | ||
| TTL Support | ✅ | ❌ | ❌ | ❌ | ✅ |
| Redis API / Command Format | ✅ | ❌ | ❌ | ❌ | ✅ |
| Persistence (Optional) | ✅ (RDB, AOF) | ✅ | ✅ | ✅ | ✅ (snapshot) |
| External Dependencies | Redis Server | SQLite Lib | RocksDB Lib | LMDB Lib | None |
| Suited for CLI Tools | ✅ | ✅ | ✅ | ✅ ✅ ✅ | |
| Zero Config / Portable | ❌ | ✅ | ✅ | ✅ ✅ ✅ |
#include "lite_redis.h"
RedisLight db;
db.set("foo", "bar");
std::string value = db.get("foo"); // "bar"
db.expire("foo", 10); // Expires in 10 seconds
db.save("snapshot.rdb");$ ./literedis-cli SET foo bar
OK
$ ./literedis-cli GET foo
bar
$ ./literedis-cli EXPIRE foo 60
OKmake libProduces libliteredis.a
make cliProduces ./literedis-cli
#include "lite_redis.h"No external dependencies required.
-
Basic Redis commands:
SET,GET,DEL,EXPIRE -
TTL eviction
-
Snapshot persistence
-
Hashes and Lists support
-
Pub/Sub (optional)
-
LRU cache mode
MIT License.
Built by Abdalla Egbareia, Computer Science gradute passionate about systems programming and developer tooling.