The fundamental logic is described in the original paper. We skip the details here and only focus on the library itself.
- Diego Ongaro and John K. Ousterhout, In Search of an Understandable Consensus Algorithm, USENIX ATC 2014.
If you are in a hurry, go to Quick Start Guide or Quick Tutorial.
It basically consists of 5 modules: Raft server, Asio layer, log store, state machine, and state manager. Raft server and Asio are provided by this library, while users should implement their own implementations of log store, state machine, and state manager.
- Raft server: coordinating all incoming requests and responses from users and other nodes.
- Asio layer: dealing with network communication and timer, as well as thread pool management.
- Log store: managing read, write, and compact operations of Raft logs.
- State machine: executing commit (optionally pre-commit and rollback), and managing snapshots.
- State manager: saving and loading cluster configuration and status.
- (Optional) Debugging logger: for system logging.