June 2017
Intermediate to advanced
400 pages
10h 32m
English
Raft is a consensus algorithm that allows distributed systems to keep a shared and managed state (https://raft.github.io/). Setting up a Raft system is complex in many ways, for one you need consensus for an election to occur and succeed. This can be difficult to bootstrap when working with multiple nodes and it can be difficult to get started. A basic cluster can be run on a single node/leader, but if you want redundancy, at least three nodes allows for a single node failure. This recipe implements a basic in-memory Raft cluster, constructs a state machine that can transition between certain allowed states, and connects the distributed state machine to a web handler that can trigger the transition. ...
Read now
Unlock full access