Mini Redis
I built a Redis compatible store in C++.
View sourceCommands and storage
I built Mini Redis in C++ to handle a request from RESP parsing through storage. It supports TTL expiration, LRU eviction, and atomic commands including INCR, DECR, INCRBY, and APPEND. A mutex protects the store of keys and values.
Persistence and networking
I added RDB snapshots and an AOF log for persistence, with a background writer handling the log output. The store also replicates from a primary to a replica. I implemented two networking paths: one thread per client and an asynchronous path using Windows IOCP.
What I measured
I wrote a C++ load generator and an asynchronous Python harness to test mixed reads and writes. In the recorded local benchmark, the store handled 27,125 requests per second with one client and 31,933 requests per second across five clients. The workload contained 150,000 mixed operations.