canonical/raft
FreeUnmaintained C implementation of the Raft consensus protocol
About canonical/raft
A fully asynchronous C implementation of the Raft consensus protocol, originally developed by Canonical's dqlite team. The library features a modular design: a platform-independent core implementing the Raft algorithm logic, and a pluggable I/O interface for networking (send/receive RPC messages) and disk persistence (store log entries and snapshots). A stock I/O implementation based on libuv is provided, though it currently requires Linux due to its use of the Linux AIO API for disk I/O. The implementation includes all basic Raft features (leader election, log replication, log compaction, membership changes) plus optional enhancements such as optimistic pipelining, parallel writing to the leader's disk, automatic stepping down, leadership transfer, and a pre-vote protocol. The project is now archived and unmaintained; the source code has been incorporated into canonical/dqlite as a private implementation detail, and users are advised to switch to the maintained fork cowsql/raft.
Key Features
Pros & Cons
- Mature implementation with all core Raft features and several optional enhancements
- Modular design allows custom I/O backends
- LGPLv3 license with static linking exception for flexible integration
- Well-documented API (raft.h) and example server code
- Project is archived and unmaintained (last release v0.18.1)
- Linux-only due to dependency on Linux AIO for disk I/O
- Stock I/O implementation requires libuv and does not support other platforms
- Replaced by the maintained fork cowsql/raft; no further development here