Skip to main content
← Projects

Projects

AdaptRaft

1 August 2024

AdaptRaft extends the standard Raft consensus protocol with a lightweight contextual bandit that continuously adjusts timing parameters based on observed round-trip times and election frequency.

Language: Go
Status: Active — feedback and contributions welcome

What it does

Standard Raft uses static election and heartbeat timeouts set at deployment time. In geo-distributed clusters, network conditions vary significantly by time of day and traffic load. AdaptRaft addresses this by:

  1. Tracking the moving distribution of observed message round-trip times
  2. Feeding these statistics to an Exp3-style bandit that selects from a small set of candidate timeout values
  3. Updating the selection each epoch based on observed election frequency (fewer elections = better reward)

The learner is fully decoupled from the Raft safety logic and can be disabled with a single flag to fall back to standard behaviour.

Getting started

git clone https://github.com/yourname/adapraft
cd adapraft
go test ./...
go run ./cmd/demo --nodes 5 --latency-profile wan

Configuration is via a TOML file; see config/example.toml.

Repository note

In a real project page, this section would link to the public repository, issue tracker, and documentation.