Skip to content
/ rafty Public

Rafty is a library for maintaining a replicated state machine following the Raft consensus protocol

License

Notifications You must be signed in to change notification settings

Lord-Y/rafty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rafty

Rafty is yet another golang library that manage to replicate log state machine. Details about Raft protocol can be found here

Reading this documentation is recommanded before going any further.

Check out these websites will also be useful:

Why another library?

There are many libraries out there implementing the search of an understandable consensus algorithm. Unfortunately, I mostly found them difficult to understand as there is not so much clear documentation about how to use them. As examples, we have production ready repositories like:

So let's try to redo the wheel with more explanations.

Supported features

Here is a list of the supported features of rafty:

  • PreVote election
  • Leader election
  • Leader lease
  • Leadership transfer
  • [] Logs
    • Log replication
    • Submit write commands
    • Submit read commands
    • Forward read/write commands to leader
    • Log compaction
  • Log storage
    • etcd bbolt for long term storage
    • log cache backed by etcd bbolt long term storage
    • in memory storage (for development)
  • Membership changes
    • Add member
    • promote member
    • demote member
    • remove member (with shutdown if proper flag set)
    • forceRemove member
    • leaveOnTerminate
  • Single server cluster
  • Bootstrap cluster
  • Snapshot
    • Take snapshot (with FSM interface)
    • Restore snapshot (with FSM interface)
    • InstallSnapshot RPC call
  • Prometheus metrics

Real world app

See real world app as implentation example.

References

About

Rafty is a library for maintaining a replicated state machine following the Raft consensus protocol

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published