module Raft

Overview

Raft consensus algorithm implementation for Crystal.

Provides a library for building distributed systems with strong consistency guarantees. A cluster of Raft::Node instances elect a leader, replicate a command log, and apply committed entries to a user-provided state machine.

node = Raft::Node.new(
  id: "node-1",
  peers: ["node-2", "node-3"],
  state_machine: my_state_machine,
  transport: Raft::Transport::InMemory.new("node-1"),
  log: Raft::Log::InMemory.new,
)
node.start
result = node.propose("SET key value".to_slice)
node.stop

Defined in:

raft.cr
raft/config.cr
raft/error.cr
raft/metrics.cr
raft/state_machine.cr
raft/transport.cr

Constant Summary

VERSION = "0.1.0"