Skip to content

abdallacodes/LiteRedis

Repository files navigation

LiteRedis

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.


🚀 Why LiteRedis?

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

🧠 Use Cases

  • 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 Comparison

Feature Redis Server SQLite RocksDB LMDB LiteRedis
Embeddable ❌ Daemon ✅ ✅ ✅
In-Memory Mode ⚠️ Disk ⚠️ Mostly
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 ⚠️ Server ✅ ✅ ✅
Zero Config / Portable ⚠️ Some ✅ ✅ ✅

🛠️ Example Usage

C++ (Library)

#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");

CLI

$ ./literedis-cli SET foo bar
OK
$ ./literedis-cli GET foo
bar
$ ./literedis-cli EXPIRE foo 60
OK

📦 Build & Installation

Library

make lib

Produces libliteredis.a

CLI Tool

make cli

Produces ./literedis-cli

Include in Your Project

#include "lite_redis.h"

No external dependencies required.


🧪 Features Roadmap

  • Basic Redis commands: SET, GET, DEL, EXPIRE

  • TTL eviction

  • Snapshot persistence

  • Hashes and Lists support

  • Pub/Sub (optional)

  • LRU cache mode


📜 License

MIT License.


👤 Author

Built by Abdalla Egbareia, Computer Science gradute passionate about systems programming and developer tooling.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors