Open source Java implementation for Raft consensus protocol.

Clone this repo:
  1. 07278cd RATIS-1064. Fix TestGrpcOutputStream.testSimpleWrite (#201) by Rui Wang · 6 hours ago master
  2. 07543a4 RATIS-455. Move exception classes to org.apache.ratis.protocol.exceptions (#203). Contributed by Rui Wang by Rui Wang · 6 days ago
  3. 5bf1430 RATIS-1063. Failed UT: testOldLeaderCommit: expected leader is different than actual leader (#197) by Rui Wang · 8 days ago
  4. a4cedc2 RATIS-1059. Avoid NPE when exportInfo is NULL in LogStateMachine.processArchiveLog (#195) by Rui Wang · 13 days ago
  5. 61f038b RATIS-1055. Switch cases should end with an unconditional "break" statement (#193) by maobaolong · 14 days 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, and rpc 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.