https://github.com/ariskk/zio-raft
An Implementation of Raft using ZIO in Scala
https://github.com/ariskk/zio-raft
raft scala zio
Last synced: 5 months ago
JSON representation
An Implementation of Raft using ZIO in Scala
- Host: GitHub
- URL: https://github.com/ariskk/zio-raft
- Owner: ariskk
- License: mit
- Created: 2020-09-12T18:31:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T13:30:33.000Z (about 4 years ago)
- Last Synced: 2024-12-06T20:54:33.948Z (over 1 year ago)
- Topics: raft, scala, zio
- Language: Scala
- Homepage:
- Size: 90.8 KB
- Stars: 36
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - ZIO Raft
README
# zio-raft
[](https://github.com/ariskk/zio-raft/blob/master/LICENSE)

An Implementation of Raft using ZIO in Scala.
## Raft
Raft is a popular consensus algorithm. It solves the problem of multiple servers needing to agree on a single value.
It is a coordination primitive often used in databases and other distributed systems.
For more info, check out the paper https://raft.github.io/
This is a work in progress implementation in Scala using ZIO for effect management. `Log`, `Storage` and `StateMachine` are pluggable and
thus different implementations can be provided. The repo currently provides a `Storage` implementation using [RocksDB](https://rocksdb.org/).
[`Raft`](https://github.com/ariskk/zio-raft/blob/master/core/src/main/scala/com.ariskk.raft/Raft.scala) contains the core implementation of the consensus algorithm.
The implementation is fully asynchronous. The consensus module is decoupled from the RPC layer and communicates with the outside world using Queues.
[`RaftServer`](https://github.com/ariskk/zio-raft/blob/master/server/src/main/scala/com.ariskk.raft.server/RaftServer.scala) contains a reference implementation of RPC
using a lightweight ZIO wrapper around Java's NIO.
For examples on how to use the `RaftServer`, please refer to [`RaftServerSpec`](https://github.com/ariskk/zio-raft/blob/master/server/src/test/scala/com.ariskk.raft.server/RaftServerSpec.scala)