Open source Java implementation for Raft consensus protocol.

Clone this repo:
  1. 53d35c0 RATIS-2020. Refactor TransactionContext to supply LogEntryProto via a ReferenceCountedObject (#1042) by Duong Nguyen · 2 days ago master
  2. 044b111 RATIS-2027. Ratis Streaming: Remote Stream copy data to heap. (#1044) by Tsz-Wo Nicholas Sze · 2 days ago
  3. 67b7650 RATIS-2021. Migrate ratis-test tests to Junit 5 - Part 2. (#1043) by Nandakumar Vadivelu · 3 days ago
  4. 16b6536 RATIS-2025. Move out assert and proto methods from RaftServerImpl. (#1041) by Tsz-Wo Nicholas Sze · 2 weeks ago
  5. 1d99921 RATIS-2024. Refactor appendEntries code. (#1040) by Tsz-Wo Nicholas Sze · 2 weeks ago

Apache Ratis

Apache Ratis is a Java library that implements the Raft protocol [1], where an extended version of the Raft paper is available at The paper introduces Raft and states its motivations in following words:

Raft is a consensus algorithm for managing a replicated log. It produces a result equivalent to (multi-)Paxos, and it is as efficient as Paxos, but its structure is different from Paxos; this makes Raft more understandable than Paxos and also provides a better foundation for building practical systems.

Ratis aims to make Raft available as a java library that can be used by any system that needs to use a replicated log. It provides pluggability for state machine implementations to manage replicated states. It also provides pluggability for Raft log, rpc implementations and metric implementations to make it easy for integration with other projects. Another important goal is to support high throughput data ingest so that it can be used for more general data replication use cases.


  1. Diego Ongaro and John Ousterhout, In Search of an Understandable Consensus Algorithm, 2014 USENIX Annual Technical Conference (USENIX ATC 14) (Philadelphia, PA), USENIX Association, 2014, pp. 305-319.