makrounaDB
Redis-inspired in-memory database,
written in modern C++.
// overview
A database that speaks Redis,
built from first principles.
makrounaDB is a lightweight, Redis-compatible in-memory key-value store that runs as a CLI server. It implements the RESP2 wire protocol — meaning any Redis client connects without modification.
Written in modern C++, it supports TTL-based key expiration, append-only file persistence, and a unique natural language interface — so you can interact with your data the way you actually think.
“Sometimes you need a lightweight, embeddable key-value store — without the operational overhead of a full Redis deployment.”
// features
Everything you need.
Nothing you don't.
RESP2 Protocol
Fully compatible with the Redis Serialization Protocol v2. Connect with any Redis client — redis-cli, Jedis, ioredis — without any code changes.
TTL Expiration
Set time-to-live on any key with EXPIRE. Lazy expiration on access, with periodic bounded cleanup run from the event loop.
AOF Persistence
Every write is appended to an AOF log in RESP-array format. On restart, the log is replayed through the same command dispatcher — zero data loss.
Natural Language CLI
Ask your database in plain English. "Set user to ghassen", "What is user?", "Expire user in 30 seconds" — the NL shell translates to RESP2.
Pasta Commands
Unique pasta-themed aliases: RIGATONI (DECR), LINGUINE (INCRBY), PENNE (SETNX), LASAGNA (RENAME), FARFALLE (GETDEL)… all real commands.
Event-Loop Server
Single-process TCP server using select() for readiness-based socket handling. Client input buffered and parsed incrementally per connection.
// command reference
Two flavors of commands.
Standard RESP2, and a pasta-themed twist.
Standard Commands
Redis-compatible RESP2 commands. Works with any existing client.
PING [message]Test connection, returns PONGECHO messageEcho back the given stringSET key valueSet a key to a string valueGET keyGet the value of a keyDEL key [key ...]Delete one or more keysEXISTS key [key ...]Test for key existenceINCR keyIncrement integer value by 1EXPIRE key secondsSet expiration in secondsTTL keyGet remaining time-to-livePasta Commands
🍝Because life is too short for boring command names. Fully functional aliases with a culinary twist — all of them are real, working commands.
RIGATONI key≡ DECRLINGUINE key amount≡ INCRBYVERMICELLI key amount≡ DECRBYSPAGHETTI key≡ STRLENPENNE key value≡ SETNXALDENTE key≡ PERSISTFARFALLE key≡ GETDELLASAGNA key newkey≡ RENAMERESP2 format: *<argc>\r\n$<len>\r\n<arg>\r\n... · + Simple string · : Integer · $ Bulk string · - Error
// how it works
Up and running in minutes.
Build the Server
Compile makrounaDB from source using CMake and Ninja. A single self-contained binary is produced — no runtime dependencies.
# Install prerequisites
sudo apt install -y g++ cmake ninja-build
# Configure and build
cmake -S . -B build -G Ninja
cmake --build build
# → ./build/makrounaDBStart It Up
Launch the server on any port. Pass an AOF file path to enable persistence. The server is ready to accept RESP2 connections immediately.
# Minimal start
./build/makrounaDB
# With explicit options
./build/makrounaDB --port 6379 --aof data/appendonly.aof
# Show all options
./build/makrounaDB --helpConnect & Query
Use any Redis client, send raw RESP2 frames via netcat, run the included Python example, or launch the natural language shell.
# Natural language shell
./build/makrounaDB --nl-shell --host 127.0.0.1 --port 6379
# Type commands like:
# set user to ghassen
# what is user?
# expire user in 30 seconds
# does user exist?
# Or send raw RESP2 via nc
printf '*3\r\n$3\r\nSET\r\n$4\r\nname\r\n$10\r\nmakrounaDB\r\n' \
| nc -N 127.0.0.1 6379Benchmark & Ship
Run the built-in benchmark suite to measure throughput, or export .deb / .rpm packages for deployment.
# Run test suite
ctest --test-dir build --output-on-failure
# Benchmark (generates benchmarks/report.md)
python3 benchmarks/simple_benchmark.py \
--host 127.0.0.1 --port 6379 --requests 5000
# Build release packages
bash scripts/release/build_release.sh --format all// architecture
Simple. Fast. Transparent.
A single-process server with a clear, linear request path. No hidden magic — just C++ doing what it does best.
Request Pipeline
Module Map
src/appCLI entrypoint and server lifecyclesrc/networkTCP server and event loopsrc/protocolRESP request parser and reply encodersrc/commandCommand routing and semanticssrc/storageKeyspace and TTL behaviorsrc/persistenceAppend-only file persistenceRoadmap
- ○Parser hardening for malformed frames and large payloads
- ○Strict RESP2 error parity matrix against Redis
- ○Worker-pool-backed background maintenance
- ○Optional snapshot persistence mode
// installation
Start in seconds.
Build from source with CMake, run as a Docker container, or grab a native .deb / .rpm package.
Build from Source
# 1. Prerequisites
sudo apt update
sudo apt install -y g++ cmake ninja-build python3 netcat-openbsd
# 2. Clone
git clone https://github.com/ghassenov/makrounaDB.git
cd makrounaDB
# 3. Build
cmake -S . -B build -G Ninja
cmake --build build
# 4. Run
./build/makrounaDB --port 6379 --aof data/appendonly.aof🐳 Docker
Container image in the works. Run anywhere with zero build step.
📦 Release Packages
Export native packages using the included release scripts.
scripts/release/build_release.sh🧪 Run Tests
ctest --test-dir build --output-on-failureDocker
# Pull the image
docker pull makrounadb/makrounadb:latest
# Run with default settings (port 6379)
docker run -p 6379:6379 makrounadb/makrounadb:latest
# Run with persistent AOF volume
docker run -p 6379:6379 \
-v $(pwd)/data:/data \
makrounadb/makrounadb:latest \
--aof /data/appendonly.aofRelease Artifacts
# Build .deb package
bash scripts/release/build_release.sh --format deb
# Build .rpm package
bash scripts/release/build_release.sh --format rpm
# Build all formats + publish GitHub Release
bash scripts/release/build_release.sh \
--format all --github-release --tag v0.1.0Ready to try makrounaDB?
Clone, build, and have a server running in under 60 seconds.