Skip to main content

Overview

Ratis is a Raft protocol library in Java. It’s not a standalone server application like Zookeeper or Consul.

EXAMPLES

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.

MAVEN USAGE

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>