Apache Ratis is a highly customizable Raft protocol implementation in Java.
Raft is a easily understandable consensus algorithm to manage replicated state.
Apache Ratis could be used in any Java application where state should be replicated between multiple instances.
Ratis provides a pluggable transport layer. By default gRPC, Netty+Protobuf and Apache Hadoop RPC based transports are provided.
Ratis supports a log and state machine. State machine typically contains the data that you want to make highly avialable. Ratis makes it easy to use your own state machine.
RAFT log is also pluggable, users can provide their own log implementation. The default implementation stores log in local files.
Application can define the polices of how to write data and where it should be written easily.
Ratis provides a log service recipe provides StateMachines to implement a distributed log service with a focused client API. For more information, please read the LogService documentation.
Apache Ratis is a Java library that can be used directly from your applications.
It is released as source code tarballs. The downloads are distributed via mirror sites and should be checked for tampering using GPG or SHA-256
The source tarball contains detailed instruction about how can it be built.
The binaries are also uploaded to the maven central for convenience. (See the getting started guide for more details)
|0.5.0||2020 Feb 4||https://www.apache.org/dist/incubator/ratis/0.5.0/||Announcement|
|0.4.0||2019 Sep 12||https://www.apache.org/dist/incubator/ratis/0.4.0/||Announcement|
|0.3.0||2019 Apr 21||https://www.apache.org/dist/incubator/ratis/0.3.0/||Announcement|
|0.2.0||2018 Jul 15||https://www.apache.org/dist/incubator/ratis/0.2.0/||Announcement|
Release artifacts are signed with one of the keys available at: https://www.apache.org/dist/incubator/ratis/KEYS
Ratis is also available from the Maven central repository.
Ratis is a Raft protocol library in Java. It's not a standalone server application like Zookeeper or Consul.
To demonstrate how to use Ratis from the code, Please look at the following examples.
Arithmetic example: This is a simple distributed calculator that replicates the values defined and allows user to perform arithmetic operations on these replicated values.
FileStore example: This is an example of using Ratis for reading and writing files.
The source code of the examples could be found in the ratis-examples sub-project.
To use in our project you can access the latest binaries from maven central:
<dependency> <artifactId>ratis-server</artifactId> <groupId>org.apache.ratis</groupId> </dependency>
You also need to include one of the transports:
<dependency> <artifactId>ratis-grpc</artifactId> <groupId>org.apache.ratis</groupId> </dependency>
<dependency> <artifactId>ratis-netty</artifactId> <groupId>org.apache.ratis</groupId> </dependency>
<dependency> <artifactId>ratis-hadoop</artifactId> <groupId>org.apache.ratis</groupId> </dependency>
Please note that Apache Hadoop dependencies are shaded, so it's safe to use hadoop transport with different versions of Hadoop.
If you'd like to contribute to Apache Ratis, please subscribe to the Ratis developer mailing list.
The Ratis developer mailing list is: firstname.lastname@example.org.
The user@ mailing list is the preferred mailing list for end-user questions and discussion.
Please use dev mailing list to address developers on a specific technical question.
The Ratis user mailing list is: email@example.com.
To post to the list, it is necessary to subscribe to it.
There is also a slack instance for discussion at https://apacheratisdev.slack.com. Please write to the mailing list if you need an invite.
Source code is part of every release, you can download the source bundles from download section and build the project according to the included instructions.
The versioned source code history is available from the Apache git repository or from the github mirror. It is only for development and not intended for use by the general public. Only the source code from the released artifacts are checked by the Project Management Committee.