VoidStore is a high-performance, event-driven in-memory key-value database built from scratch in C++ using Linux epoll.
It implements core systems found in real-world data stores, including non-blocking I/O, RESP protocol parsing, TTL expiration, and append-only persistence.
To understand how systems like Redis handle networking, concurrency, and data persistence internally—beyond just using them as black boxes.
g++ src/*.cpp -Iinclude -o server
./server
redis-cli -p 8080Handles ~60K requests/sec on local machine (single-threaded, epoll-based event loop).
Measured over multiple runs using redis-cli with piped input (100K SET operations) under minimal system load. Results include client-side overhead.
Observed range: ~60K–63K ops/sec.
Single-threaded design; performance can be further improved using pipelining and multi-threaded request handling.
- Event-driven server using
epoll(non-blocking I/O) - Redis-compatible RESP protocol parsing
- Multiple commands parsing using pipelining
- Multi-client TCP handling using sockets
- In-memory key-value storage with TTL expiration
- Append-Only File (AOF) persistence for durability
- Command support via
redis-cli
Single Command
SET key value
SET key value ttl
GET key
DEL key
Multiple Commands
printf '*3\r\n$3\r\nSET\r\n$4\r\nkey1\r\n$6\r\nvalue1\r\n*2\r\n$3\r\nGET\r\n$4\r\nkey1\r\n' | nc localhost 8080
- Designed an event-driven architecture using epoll for efficient multi-client handling
- Implemented lazy TTL expiration during read operations
- Built a custom RESP parser to handle Redis protocol communication
- Implemented AOF logging and replay to recover state on restart
- Used unordered_map for O(1) average-time operations
- This project focuses on understanding system internals rather than replicating full Redis functionality.
Systems like VoidStore (and Redis) are commonly used for:
- Caching frequently accessed data
- Managing user sessions and authentication
- Real-time features like chat presence
- Background job queues and rate limiting
- C++
- POSIX sockets
- epoll (Linux I/O multiplexing)
- Redis RESP protocol
- STL (unordered_map)
- LIST / SET data structures
- Background TTL cleaner (active expiration)
- RDB snapshot persistence
- Replication support
- Non-blocking socket improvements

