# willemt/raft

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/willemt-raft).**

1,168 stars · 275 forks · C · NOASSERTION

## Links

- GitHub: https://github.com/willemt/raft
- awesome-repositories: https://awesome-repositories.com/repository/willemt-raft.md

## Topics

`raft-consensus-algorithm`

## Description

Raft is a portable C programming library that implements the Raft distributed consensus protocol. It serves as a state machine replication engine and coordination primitive for building fault-tolerant distributed applications and clustered systems. 

The library manages leader election timeouts, heartbeat monitoring, and log replication across peer nodes to maintain consistent state across servers. It handles client write operations, redirects requests from non-leader nodes, processes voting and replication messages, and supports dynamic cluster membership changes through specialized log entries and notifications. 

For data management and system integration, the engine captures point-in-time state snapshots and trims older log entries to recover disk space. It relies on application integration hooks to bridge the consensus engine with external messaging, log application, and persistent storage infrastructure, while timing mechanisms advance election and heartbeat intervals through host application event loops.

## Tags

### DevOps & Infrastructure

- [Consensus-Based State Replication](https://awesome-repositories.com/f/devops-infrastructure/state-and-configuration-replication/consensus-based-state-replication.md) — Coordinates node elections, heartbeat monitoring, and log replication across a cluster to maintain consistent state across servers.
- [Client Write Processors](https://awesome-repositories.com/f/devops-infrastructure/high-availability-clusters/log-replication-strategies/consensus-log-replication/client-write-processors.md) — Appends incoming write operations to the replicated log, redirects non-leader clients, and manages client acknowledgments. ([source](https://github.com/willemt/raft#readme))
- [Replicated Log Management](https://awesome-repositories.com/f/devops-infrastructure/high-availability-clusters/replicated-log-management.md) — Manages append-entries RPCs and maintains persistent disk journals to ensure ordered synchronization across cluster peers.
- [Quorum-Based Elections](https://awesome-repositories.com/f/devops-infrastructure/remote-cluster-access/cluster-failover-managers/automated-master-failovers/quorum-based-elections.md) — Drives leader election timeouts and validates majority acknowledgments before committing state transitions or cluster changes.

### Networking & Communication

- [Raft Consensus Implementations](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-systems-coordination/distributed-consensus-protocols/raft-consensus-implementations.md) — Implements the Raft distributed consensus protocol in C for building fault-tolerant replicated state machines and clustered systems.

### Data & Databases

- [Consensus Engines](https://awesome-repositories.com/f/data-databases/consensus-engines.md) — Coordinates leader election, log replication, and cluster membership changes across peer nodes as a state machine replication engine.
- [Protocol Message Deserializers](https://awesome-repositories.com/f/data-databases/distributed-consensus-protocols/protocol-message-deserializers.md) — Deserializes incoming network messages for voting and log replication, processes state transitions, and generates corresponding response payloads. ([source](https://github.com/willemt/raft#readme))
- [Dynamic Cluster Membership Management](https://awesome-repositories.com/f/data-databases/dynamic-cluster-membership-management.md) — Dynamically adds or removes cluster nodes through specialized log entries and membership notification callbacks to safely scale the system. ([source](https://github.com/willemt/raft/blob/master/README.rst))
- [Snapshot-Based Compactions](https://awesome-repositories.com/f/data-databases/log-processing-engines/log-compaction/snapshot-based-compactions.md) — Captures point-in-time snapshots of the state machine and trims older log entries to recover memory and disk space. ([source](https://github.com/willemt/raft/blob/master/README.rst))
- [Raft Implementations](https://awesome-repositories.com/f/data-databases/raft-implementations.md) — Builds fault-tolerant distributed systems and replicated state machines using the Raft consensus algorithm for reliable data synchronization.

### Software Engineering & Architecture

- [Replicated State Machines](https://awesome-repositories.com/f/software-engineering-architecture/state-machine-logic/replicated-state-machines.md) — Processes replicated log commands sequentially to transition state deterministically across all nodes in the distributed cluster.
- [Consensus Hook Interfaces](https://awesome-repositories.com/f/software-engineering-architecture/application-logic-hooks/consensus-hook-interfaces.md) — Implements required hooks for messaging, log application, and persistent storage to bridge the consensus engine with application infrastructure. ([source](https://github.com/willemt/raft/blob/master/README.rst))
- [Server Instantiation Routines](https://awesome-repositories.com/f/software-engineering-architecture/consensus-state-initialization/server-instantiation-routines.md) — Instantiates new consensus server instances and configures cluster topology by registering peer nodes with unique identifiers and user data pointers. ([source](https://github.com/willemt/raft#readme))
- [Consensus Integration Bridges](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures/plugin-based-architectures/bridge-layer-interfaces/consensus-integration-bridges.md) — Bridges the core consensus state machine with external networking and storage systems through a strict function hook interface.
- [Timeout Progress Tickers](https://awesome-repositories.com/f/software-engineering-architecture/state-machine-logic/lightweight-state-machines/automation-state-machines/timeout-progress-tickers.md) — Triggers periodic timers at regular intervals to advance timeouts and move background consensus state transitions forward. ([source](https://github.com/willemt/raft/blob/master/README.rst))

### Operating Systems & Systems Programming

- [C Libraries](https://awesome-repositories.com/f/operating-systems-systems-programming/c-libraries.md) — Provides a portable programming library offering core coordination primitives for fault-tolerant distributed applications.

### Programming Languages & Runtimes

- [Consensus Ticker Utilities](https://awesome-repositories.com/f/programming-languages-runtimes/periodic-timer-implementations/consensus-ticker-utilities.md) — Drives timed background checks and timeout handling by invoking periodic tick functions at regular intervals through external timers. ([source](https://github.com/willemt/raft#readme))
- [Event Loop Injections](https://awesome-repositories.com/f/programming-languages-runtimes/periodic-timer-implementations/event-loop-injections.md) — Advances election and heartbeat timeouts by injecting regular interval ticks from the host application event loop.
