Skip to content

Samriddha9619/Raft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raft Consensus Algorithm in Go

A robust implementation of the Raft distributed consensus algorithm written in Go.

This project implements the core logic of the Raft state machine, designed as an asynchronous, event-driven module that can be embedded into higher-level applications (such as a distributed Key-Value store).

Features Implemented

  • Leader Election: Randomized election timeouts, RequestVote RPC handling, and role transitions (Follower -> Candidate -> Leader).
  • Log Replication: AppendEntries RPCs, log matching property enforcement, and commit index advancement.
  • RawNode Interface: An asynchronous boundary layer that encapsulates Raft state mutations into Ready objects to be processed by the host application (handling persistent storage, network message broadcasting, and state machine application).
  • Event-Driven Ticking: Uses a logical clock (Tick) instead of a physical clock timer, granting the host application full control over execution timing and making it highly deterministic for testing.

Testing & Acknowledgements

This implementation was rigorously verified and tested against the comprehensive test suite provided by the PingCAP TinyKV training assignment.

The test files have been intentionally omitted from this standalone repository to maintain focus purely on the core Raft consensus logic. I would like to acknowledge and thank PingCAP for providing the excellent testing framework and scenarios that made validating this implementation possible.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages