2018 SJTU PPCA project
Consensus algorithms allow a collection of machines to work as a coherent group that can survive the failues of some of its members. Thus they play a key role in building reliable large-scale software systems. Raft is an understandable and practical consensus algorithm. A server in our constext is typically modeled as a replicated state machine. It executes a series of commands stored in replicated log in order. Keeping relicated log consistent ensures all state machines operate in the same way. In our implementation, user interface is defined as a KV map which supports "Put" and "Get" methods.
- Servers never return an incorrect result.
- Server cluster is fully functional as long as majority of the servers are operational and can communicate with each other and with clients.
- They don't depend on consistent timing.
- A command can complete as soon as a majority of the cluster has responded to a single round of remote procedure calls; a minority of slow servers needn't impacting overall system performance.
Use c++ boost library to for multi-thread, and gRPC for remote procedure call.