A Redis-like in-memory key-value store written in C++ for learning systems programming.
Goal: by building a tiny version from scratch.
My goal for this project is to expose myself to C++, being proficient in C, I want to utilize this towards a more object-oriented language. This was also created to gain a better understanding of how a real-world database server works under the hood
This project covers:
- Network programming – sockets, event loops, handling multiple clients.
- Concurrency - multi-threaded request handling with 'std::thread'
- Systems-level C++ – working directly with POSIX APIs
This is a learning project, not production software.
- TCP server that accepts multiple concurrent clients
- Persistent connections (multiple commands per session)
- Supported Commands (atm)
PING- returnsPONGECHO <message>- returns<message>QUIT- closes the connection
- C++
- POSIX sockets
STD::threadfor concurrency- macOS / Linux
g++ -o server server.cpp -pthread
g++ -o client client.cppStart the server:
./serverIn a new terminal window
./clientThen enter any command into the client terminal to get the result
EXAMPLE OUTPUTS FOR INPUTS
PING
PONG
ECHO hello world
hello world
QUIT
SETandGETcommands with hash tables- key expiration
- nonblocking i/o with an event loop