This is a simple KV database based on Raft algorithm,this implementation is very easy to understand
make
# node1 [leader]
./build/server --local http://127.0.0.1:8080 --peer http://127.0.0.1:8081 --peer http://127.0.0.1:8082
# node2
./build/server --local http://127.0.0.1:8081 --peer http://127.0.0.1:8082 --peer http://127.0.0.1:8080
# node3
./build/server --local http://127.0.0.1:8082 --peer http://127.0.0.1:8081 --peer http://127.0.0.1:8080# set key
./build/client set key1 val1 -a http://127.0.0.1:8080
# get key
./build/client get key1 -a http://127.0.0.1:8081
# rm key
./build/client rm key1 -a http://127.0.0.1:8080
- I will change the
MemStoragemethod to store the log on disk - I'm going to use
LSM treesand other, more advanced data structures - Add tests