Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.
/ sraft Public archive

simple RAFT implementation in Java. For educational purposes

License

Notifications You must be signed in to change notification settings

tuannh982/sraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
tuannh29
Jul 19, 2021
b052705 · Jul 19, 2021

History

18 Commits
Jul 19, 2021
Jan 5, 2021
Jan 7, 2021
Jul 19, 2021
Jul 19, 2021

Repository files navigation

Simple RAFT implementation

Introduction

Consensus algorithm implementation (RAFT)

from paper https://raft.github.io/raft.pdf

demonstration http://thesecretlivesofdata.com/raft/

Quickstarts

run main in class Test

Features

  • leader election
  • logs replication
  • membership change
  • log compaction

Note #1: this project only for educational purpose, those features will not be optimized for production

Note #2: membership change and log compaction are not implemented since we only need leader election and logs replication

TODOs

  • network emulation
    • join/leave network
    • transport (send, recv, broadcast)
    • message encapsulation
    • async IO (simple message queue)
    • network jamming
    • test
  • timer
    • scheduled task
    • listen/notify
    • change timeout
    • test
  • raft
    • rpc
      • AppendEntries
      • AppendEntries response (custom)
      • RequestVote
      • RequestVote response
      • test
    • client command (deposit, withdraw)
      • test
    • states
      • leader
        • heartbeat
        • send logs
        • test
      • voter
        • handle RequestVote message
        • test
      • candidate
        • broadcast RequestVote
        • collect votes
        • test
      • follower
        • handle AppendEntries message
        • test
    • FSM
      • transition table
      • state change listener
      • test
    • raft log
      • test

About

simple RAFT implementation in Java. For educational purposes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages