Skip to content

Consensus algorithm in distributed computing. Used for building resilient, fault tolerant multi-node systems

Notifications You must be signed in to change notification settings

psrijan/Raft-Consensus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RAFT-CONSENSUS:

Overview

  1. Raft is a distributed consensus algorithm that enables nodes in a cluster to self organize and work together regardless of indeterministic conditions in distributed computing: such as network partitions, node failures.
  2. Raft uses the concept of distributed log replication, to agree upon the work, each raft node has committed in it's distributed logs. This is done via three types of raft cluster nodes (LEADER, FOLLOWER and CANDIDATE) nodes.
  3. Raft's node population, like humans, elect LEADERs which instruct other nodes on operations to perform in the nodes local state. Elections are successful when there is more than 50% node that vote for a particular CANDIDATE node, which wants to be a leader. This is called consensus in raft.
  4. In addition to this, Raft also needs to have distributed consensus when performing tasks. Each Raft node replicates the requests client sends to the leader. This is replication is one reason why RAFT is so tolerant on failures.
  5. RAFT also has a mechanism to commit logs. When RAFT leader identifies over 50% of the nodes have replicated the log, the leader commits the RAFT log and requests FOLLOWERS to do the same. This is yet another form of consensus seen in RAFT.

Implementation Details:

This version of RAFT is implemented in AKKA. AKKA is a library for building concurrent and distributed systems in Java, Scala .Net. In this version of RAFT, I implement a 5 node distributed RAFT node, that maintains ticket information across different devices. In addition to this, the RAFT cluster also maintains notions of CONSISTENT and INCONSISTENT reads. CONSISTENT reads are accurate and exact reads in the RAFT system. However, obtaining consistent reads in distributed computing can sometimes be expensive in terms of time and compute resources. To handle these trade offs, the version also implements INCONSISTENT reads, which enables raft nodes to estimate the number of remaining TICKETS which is currently available in the system. Such mixed consistency modesl are important use cases for distributed computing. For instance, it is likely that systems such as AMAZONs shooping carts show tentative number of items avaiable in their warehouse rather than displaying their exact amount.

Video Link - Raft Explaination and Implementation

About

Consensus algorithm in distributed computing. Used for building resilient, fault tolerant multi-node systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published