Crate lol_core[][src]

Raft is a distributed consensus algorithm widely used nowadays to build distributed applications like etcd. However, while it is even understandable than notorious Paxos algorithm it is still difficult to implement correct and efficient implementation.

This library is a Raft implementation based on Tonic, a gRPC library based on Tokio. By exploiting gRPC features like streaming, the inter-node log replication and snapshot copying is very efficient. Also, zero-copy ser/desr between replication stream and the log entries is another goal of this library in term of efficiency.

Modules

compat

Simple and backward-compatible RaftApp trait.

connection

Utilities for connection.

core_message

The request and response that RaftCore talks.

proto_compiled

Proto file compiled.

snapshot

The snapshot abstraction and some basic implementations.

storage

The abstraction for the backing storage and some implementations.

Structs

Config

Static configuration in initialization.

RaftCore

RaftCore is the heart of the Raft system. It does everything Raft should do like election, dynamic membership change, log replication, sending snapshot in stream and interaction with user-defined RaftApp.

TunableConfig

Dynamic configurations.

Enums

MakeSnapshot

Plan to make a new snapshot.

Traits

RaftApp

The abstraction for user-defined application runs on the RaftCore.

Functions

make_service

Lift RaftCore to Service.

Type Definitions

Id

Unique identifier of a Raft node.

Index

Log index.

RaftService