Raftex
An implementation of the Raft Consensus Algorithm in Elixir/Erlang using distributed finite state machines (gen_fsm
).
What is Consensus / what is Raft?
From the official website:
Consensus is a fundamental problem in fault-tolerant distributed systems. Consensus involves multiple servers agreeing on values. (โฆ) Raft is a consensus algorithm that is designed to be easy to understand. It's equivalent to Paxos in fault-tolerance and performance. The difference is that it's decomposed into relatively independent subproblems, and it cleanly addresses all major pieces needed for practical systems.
Installation
- Clone the repository with
git clone [email protected]:my-flow/raftex.git
. - Install the required dependencies with
mix deps.get
.
Watch simulation in a browser
- Start web server with
mix phoenix.start
- Open a web browser and visit URL http://localhost:4000
Watch simulation in a terminal
- Start Elixir's interactive shell with
iex -S mix
. - Run a simulation with 5 distributed nodes:
iex(1)> Raftex.run
Copyright & License
Copyright (c) 2014-2015 Florian J. Breunig
Licensed under MIT, see LICENSE file.