A fault-tolerant distributed key-value database implementing the Raft consensus algorithm to improve my C++ skills and deepen my understanding of distributed systems architecture.
- Distributed Consensus: Implements the Raft algorithm for leader election and log replication
- Fault Tolerance: Automatic failover and recovery when nodes go down
- Key-Value Operations: Support for PUT, GET, and DELETE operations
- Multi-Node Architecture: Distributed across multiple nodes with data consistency
- gRPC Communication: Inter-node communication and client interface using Protocol Buffers
- Persistent Logging: Durable transaction logs for data recovery
- C++17
- CMake 3.16
- Protocol Buffers compiler (
protoc) - gRPC C++ libraries
-
Generate Protocol Buffer files
mkdir generated protoc --cpp_out=generated --grpc_out=generated --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` --proto_path=proto proto/*.proto
-
Build the project
mkdir build && cd build cmake .. make
-
Run the database
cd build ./raft_demo
main.cpp file showcases some of the distributed system features