mini-redis
mini-redis is a Redis-inspired key-value store built in C++. It implements a smaller version of Redis from scratch, including networking, parsing, persistence, recovery, TTL, eviction, testing, and benchmarks.
mini-redis is a Redis-inspired key-value store built in C++. It implements a smaller version of Redis from scratch, including networking, parsing, persistence, recovery, TTL, eviction, testing, and benchmarks.
ops/sec on the normal generated-value run.
Expiration is wired through the full command path, not bolted on afterward.
State comes back on restart by replaying the append-only persistence log.
Building a smaller version from scratch made the tradeoffs much more concrete: what has to happen between a line of client input and a durable state change, how eviction affects behavior, and where a simple protocol starts to show strain.
That hands-on path taught me more than reading about the design alone. It forced me to think about correctness, state recovery, concurrency, and performance together.
The TCP server accepts command input from connected clients on localhost.
The parser translates text commands into a structured internal representation.
The executor updates the key-value store, including TTL handling and delete paths.
Mutating commands are written to the append-only log so the server can recover state.