SlideShare a Scribd company logo
2
Most read
11
Most read
12
Most read
Raft
Understandable Consensus Algorithm
Presentation for Seminar
Muayyad Saleh Alsadi
(20158043)
Based on Raft Paper
“In Search of an Understandable
Consensus Algorithm”
Diego Ongaro and John Ousterhout, Stanford
University
Raft
Introduction
Introduction
Raft is a consensus algorithm for managing a
replicated log. It produces a result equivalent
to multi-Paxos, and it is as efficient as Paxos
but with completely different structure meant
to be understandable as the most key
objective.
Raft
Introduction to consensus algorithms
What is a consensus
algorithm?
“Consensus algorithms allow a collection of
machines to work as a coherent group that
can survive the failures of some of its
members. Because of this, they play a
key role in building reliable large-scale
software systems.”
Raft
Introduction to consensus algorithms
Replicated State
Machine
a collection of servers
compute identical copies
of the same state and can
continue operating even if
some of the servers are
down. Replicated state
machines are used to
solve a variety of fault
tolerance problems in
distributed systems.
Raft
Introduction to consensus algorithms
Why not Paxos?
“There are significant gaps between the
description of the Paxos algorithm and the
needs of a real-world system… the final
system will be based on an unproven
protocol”
Quoted from Google's Chubby implementers
Raft
Introduction to consensus algorithms
Why not Paxos?
#1 Single-decree Paxos is dense and subtle:
it is divided into two stages that do not have
simple intuitive explanations and cannot be
understood independently. Because of this, it
is difficult to develop intuitions about why the
single-decree protocol works. The
composition rules for multi-Paxos add
significant additional complexity and subtlety.
Raft
Introduction to consensus algorithms
Why not Paxos?
#2 it does not provide a good foundation for
building practical implementations. One
reason is that there is no widely agreed-upon
algorithm for multi-Paxos. Lamport’s
descriptions are mostly about single-decree
Paxos; he sketched possible approaches to
multi-Paxos, but many details are missing.
Raft
Properties and key features
Novel features of Raft:
● Strong leader: Log entries only flow from the leader to
other servers. This simplifies the management of the
replicated log and makes Raft easier to understand.
● Leader election: beside heartbeats required in any
consensus algorithm, Raft uses randomized timers to elect
leaders. This helps resolving conflicts simply and rapidly.
● Membership changes: changing the set of servers in the
cluster uses a new joint consensus approach where the
majorities of two different configurations overlap during
transitions. This allows the cluster to continue operating
normally during configuration changes.
Raft
Properties and key features
consensus algorithm properties
● Safety: never returning an incorrect result in any condition
despite network delays, partitions, and packet loss,
duplication, and reorder
● Fault-tolerant: the system would be available and fully-
functional in case of failure of some nodes.
● Does not depend on time consistency:
● Performance is not affected by minority of slow nodes
Raft
Sub-problems
● Leader election: system should continue to work even if
its leader fails, by electing a new leader
● Log replication: leader takes operations from clients and
replicate them into all nodes. Forcing them all to agree.
● Safety: assert that the 5 guarantees (next slide) are all
satisfied at any time
Raft
The 5 guarantees
1)Election Safety: at most one leader can be elected in a
given term.
2)Leader Append-Only: a leader never overwrites or
deletes entries in its log; it only appends new entries.
3)Log Matching: if two logs contain an entry with the same
index and term, then the logs are identical in all entries up
through the given index.
4)Leader Completeness: if a log entry is committed in a
given term, then that entry will be present in the logs of
the leaders for all higher-numbered terms.
5)State Machine Safety: if a server has applied a log
entry at a given index to its state machine, no other server
will ever apply a different log entry for the same index.
Raft
The Basics: The 3 node states
Raft
The Basics: Terms
Raft
The Basics: no emerging leader term
Raft
The Basics: Heartbeat RPC used to append
Raft
The Basics: Request Vote
Raft
Partition tolerance
Node B consider itself a lead (from old term) but it can reach
Consensus so it won't affect consistency
Raft
Follower Cases
A follower might have
missed some entries
as in a-b.
Or have extra
“uncommitted”
entries as in c-f (that
should be removed)
F was a leader of
term 2 that
committed some
changes then failed
Raft
Working conditions
broadcastTime ≪ electionTimeout ≪ MTBF
Where MTBF: is mean time between failures
Raft
Tuning for time without leader
Time without leader By tuning random timeout range
Raft
How Understandable?
Raft
Resources
● The Paper
● Visualization of Raft operations
● Etcd - implementation
● Consul – another implementation
● http://raftconsensus.github.io/
● CoreOS/Fleet uses Etcd
● Google Kubernetes - a distributed system
● Mesos / Mesosphere– a distributed system

More Related Content

What's hot (20)

PDF
ELK, a real case study
Paolo Tonin
 
PDF
Blockchain Security Issues and Challenges
Merlec Mpyana
 
PPTX
Distributed systems and blockchain technology
Alket Cecaj
 
PPTX
Gfs vs hdfs
Yuval Carmel
 
PDF
Hudi architecture, fundamentals and capabilities
Nishith Agarwal
 
PDF
Parquet performance tuning: the missing guide
Ryan Blue
 
PDF
Blockchain
Venkatesh Jambulingam
 
PPTX
Apache Beam: A unified model for batch and stream processing data
DataWorks Summit/Hadoop Summit
 
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
PPTX
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
Simplilearn
 
PPTX
Hyperledger Fabric
Murughan Palaniachari
 
PDF
Prometheus Overview
Brian Brazil
 
PPTX
Apache Storm
masifqadri
 
PPTX
Kafka 101
Aparna Pillai
 
KEY
Introduction to memcached
Jurriaan Persyn
 
PDF
Ethereum in a nutshell
Daniel Chan
 
PPTX
Blockchain Consensus Protocols
Melanie Swan
 
PDF
Data ingestion and distribution with apache NiFi
Lev Brailovskiy
 
PPTX
Hyperledger fabric 20180528
Arnaud Le Hors
 
PDF
ksqlDB - Stream Processing simplified!
Guido Schmutz
 
ELK, a real case study
Paolo Tonin
 
Blockchain Security Issues and Challenges
Merlec Mpyana
 
Distributed systems and blockchain technology
Alket Cecaj
 
Gfs vs hdfs
Yuval Carmel
 
Hudi architecture, fundamentals and capabilities
Nishith Agarwal
 
Parquet performance tuning: the missing guide
Ryan Blue
 
Apache Beam: A unified model for batch and stream processing data
DataWorks Summit/Hadoop Summit
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
What Is Apache Spark? | Introduction To Apache Spark | Apache Spark Tutorial ...
Simplilearn
 
Hyperledger Fabric
Murughan Palaniachari
 
Prometheus Overview
Brian Brazil
 
Apache Storm
masifqadri
 
Kafka 101
Aparna Pillai
 
Introduction to memcached
Jurriaan Persyn
 
Ethereum in a nutshell
Daniel Chan
 
Blockchain Consensus Protocols
Melanie Swan
 
Data ingestion and distribution with apache NiFi
Lev Brailovskiy
 
Hyperledger fabric 20180528
Arnaud Le Hors
 
ksqlDB - Stream Processing simplified!
Guido Schmutz
 

Viewers also liked (20)

PDF
RAFT Consensus Algorithm
sangyun han
 
PDF
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياه
muayyad alsadi
 
PDF
الاختيار بين التقنيات
muayyad alsadi
 
PDF
How to think like hardware hacker
muayyad alsadi
 
PDF
Algoritmos de Consenso: Paxos vs RAFT
Maycon Viana Bordin
 
DOC
2 research design
usman nazir
 
PPTX
Chicken buiscuit
usman nazir
 
PPTX
7 Biggest Divorce Mistakes
Joryn Jenkins
 
PPTX
20140517 なんでも勉強会 にゃんたこす_rev02
Toshiaki Yamanishi
 
PPTX
88 gibraltar investment presentation
88gibraltar
 
PDF
New design knowlege - Manzini
Francisco Gómez Castro
 
PDF
Ovario poliquistico
Jenny Elizabeth Molina Gavilan
 
PPTX
智慧城市
Yu-Ting Lai
 
DOCX
Power system
ChandruSimbu
 
PPTX
쉐어몬스터 소개
윤근 강
 
PDF
Cert Degree
Zamri Zainol
 
PPS
av başladı
Erol Kahraman
 
PDF
88 Gibraltar Pricelist Tower 2
88gibraltar
 
RAFT Consensus Algorithm
sangyun han
 
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياه
muayyad alsadi
 
الاختيار بين التقنيات
muayyad alsadi
 
How to think like hardware hacker
muayyad alsadi
 
Algoritmos de Consenso: Paxos vs RAFT
Maycon Viana Bordin
 
2 research design
usman nazir
 
Chicken buiscuit
usman nazir
 
7 Biggest Divorce Mistakes
Joryn Jenkins
 
20140517 なんでも勉強会 にゃんたこす_rev02
Toshiaki Yamanishi
 
88 gibraltar investment presentation
88gibraltar
 
New design knowlege - Manzini
Francisco Gómez Castro
 
Ovario poliquistico
Jenny Elizabeth Molina Gavilan
 
智慧城市
Yu-Ting Lai
 
Power system
ChandruSimbu
 
쉐어몬스터 소개
윤근 강
 
Cert Degree
Zamri Zainol
 
av başladı
Erol Kahraman
 
88 Gibraltar Pricelist Tower 2
88gibraltar
 
Ad

Similar to Introduction to Raft algorithm (20)

PDF
uiuc2016.pdf
202211072
 
PDF
uiuc201 6-merged.pdf
testsigma
 
PDF
Raft_Diego_Ongaro.pdf
jsathy97
 
PPTX
Paxos vs Raft Have we reached consensus on distributed consensus.pptx
mahdiaghaei19
 
PDF
Distributed Consensus: Making the Impossible Possible
C4Media
 
ODP
Consensus algo with_distributed_key_value_store_in_distributed_system
Atin Mukherjee
 
PPTX
CLI_Raft_Implementation_With_Video through implememntation in pythion
sirireddy1220
 
PDF
Coordination in distributed systems
Andrea Monacchi
 
PDF
Distributed Consensus: Making Impossible Possible
Heidi Howard
 
PDF
Distributed Consensus: Making Impossible Possible by Heidi howard
J On The Beach
 
PPTX
[Yu cheng lin]cloud presentation - Raft
lin yucheng
 
PDF
Bearded gurus
Sylvain Abélard
 
PDF
Consensus algorithms_PapersWeLove2018Sep
Yifan Xing
 
PDF
Distributed Consensus: Making Impossible Possible [Revised]
Heidi Howard
 
PDF
RAFT In Search of an Understandable Consensus Algorithm Presentation PPT
DiwasPandey3
 
PDF
Consensus Algorithms in Distributed Systems LambdaWorld2018
Yifan Xing
 
PPTX
ensures that multiple servers (or nodes) agree on a shared state, even in the...
AlmabrukSultan1
 
PPTX
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1-1.pptx
ssuseree5591
 
PDF
Raft协议
Justin Li
 
PPTX
Square's Lessons Learned from Implementing a Key-Value Store with Raft
ScyllaDB
 
uiuc2016.pdf
202211072
 
uiuc201 6-merged.pdf
testsigma
 
Raft_Diego_Ongaro.pdf
jsathy97
 
Paxos vs Raft Have we reached consensus on distributed consensus.pptx
mahdiaghaei19
 
Distributed Consensus: Making the Impossible Possible
C4Media
 
Consensus algo with_distributed_key_value_store_in_distributed_system
Atin Mukherjee
 
CLI_Raft_Implementation_With_Video through implememntation in pythion
sirireddy1220
 
Coordination in distributed systems
Andrea Monacchi
 
Distributed Consensus: Making Impossible Possible
Heidi Howard
 
Distributed Consensus: Making Impossible Possible by Heidi howard
J On The Beach
 
[Yu cheng lin]cloud presentation - Raft
lin yucheng
 
Bearded gurus
Sylvain Abélard
 
Consensus algorithms_PapersWeLove2018Sep
Yifan Xing
 
Distributed Consensus: Making Impossible Possible [Revised]
Heidi Howard
 
RAFT In Search of an Understandable Consensus Algorithm Presentation PPT
DiwasPandey3
 
Consensus Algorithms in Distributed Systems LambdaWorld2018
Yifan Xing
 
ensures that multiple servers (or nodes) agree on a shared state, even in the...
AlmabrukSultan1
 
vnd.openxmlformats-officedocument.presentationml.presentation&rendition=1-1.pptx
ssuseree5591
 
Raft协议
Justin Li
 
Square's Lessons Learned from Implementing a Key-Value Store with Raft
ScyllaDB
 
Ad

Recently uploaded (20)

PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 

Introduction to Raft algorithm

  • 1. Raft Understandable Consensus Algorithm Presentation for Seminar Muayyad Saleh Alsadi (20158043) Based on Raft Paper “In Search of an Understandable Consensus Algorithm” Diego Ongaro and John Ousterhout, Stanford University
  • 2. Raft Introduction Introduction Raft is a consensus algorithm for managing a replicated log. It produces a result equivalent to multi-Paxos, and it is as efficient as Paxos but with completely different structure meant to be understandable as the most key objective.
  • 3. Raft Introduction to consensus algorithms What is a consensus algorithm? “Consensus algorithms allow a collection of machines to work as a coherent group that can survive the failures of some of its members. Because of this, they play a key role in building reliable large-scale software systems.”
  • 4. Raft Introduction to consensus algorithms Replicated State Machine a collection of servers compute identical copies of the same state and can continue operating even if some of the servers are down. Replicated state machines are used to solve a variety of fault tolerance problems in distributed systems.
  • 5. Raft Introduction to consensus algorithms Why not Paxos? “There are significant gaps between the description of the Paxos algorithm and the needs of a real-world system… the final system will be based on an unproven protocol” Quoted from Google's Chubby implementers
  • 6. Raft Introduction to consensus algorithms Why not Paxos? #1 Single-decree Paxos is dense and subtle: it is divided into two stages that do not have simple intuitive explanations and cannot be understood independently. Because of this, it is difficult to develop intuitions about why the single-decree protocol works. The composition rules for multi-Paxos add significant additional complexity and subtlety.
  • 7. Raft Introduction to consensus algorithms Why not Paxos? #2 it does not provide a good foundation for building practical implementations. One reason is that there is no widely agreed-upon algorithm for multi-Paxos. Lamport’s descriptions are mostly about single-decree Paxos; he sketched possible approaches to multi-Paxos, but many details are missing.
  • 8. Raft Properties and key features Novel features of Raft: ● Strong leader: Log entries only flow from the leader to other servers. This simplifies the management of the replicated log and makes Raft easier to understand. ● Leader election: beside heartbeats required in any consensus algorithm, Raft uses randomized timers to elect leaders. This helps resolving conflicts simply and rapidly. ● Membership changes: changing the set of servers in the cluster uses a new joint consensus approach where the majorities of two different configurations overlap during transitions. This allows the cluster to continue operating normally during configuration changes.
  • 9. Raft Properties and key features consensus algorithm properties ● Safety: never returning an incorrect result in any condition despite network delays, partitions, and packet loss, duplication, and reorder ● Fault-tolerant: the system would be available and fully- functional in case of failure of some nodes. ● Does not depend on time consistency: ● Performance is not affected by minority of slow nodes
  • 10. Raft Sub-problems ● Leader election: system should continue to work even if its leader fails, by electing a new leader ● Log replication: leader takes operations from clients and replicate them into all nodes. Forcing them all to agree. ● Safety: assert that the 5 guarantees (next slide) are all satisfied at any time
  • 11. Raft The 5 guarantees 1)Election Safety: at most one leader can be elected in a given term. 2)Leader Append-Only: a leader never overwrites or deletes entries in its log; it only appends new entries. 3)Log Matching: if two logs contain an entry with the same index and term, then the logs are identical in all entries up through the given index. 4)Leader Completeness: if a log entry is committed in a given term, then that entry will be present in the logs of the leaders for all higher-numbered terms. 5)State Machine Safety: if a server has applied a log entry at a given index to its state machine, no other server will ever apply a different log entry for the same index.
  • 12. Raft The Basics: The 3 node states
  • 14. Raft The Basics: no emerging leader term
  • 15. Raft The Basics: Heartbeat RPC used to append
  • 17. Raft Partition tolerance Node B consider itself a lead (from old term) but it can reach Consensus so it won't affect consistency
  • 18. Raft Follower Cases A follower might have missed some entries as in a-b. Or have extra “uncommitted” entries as in c-f (that should be removed) F was a leader of term 2 that committed some changes then failed
  • 19. Raft Working conditions broadcastTime ≪ electionTimeout ≪ MTBF Where MTBF: is mean time between failures
  • 20. Raft Tuning for time without leader Time without leader By tuning random timeout range
  • 22. Raft Resources ● The Paper ● Visualization of Raft operations ● Etcd - implementation ● Consul – another implementation ● http://raftconsensus.github.io/ ● CoreOS/Fleet uses Etcd ● Google Kubernetes - a distributed system ● Mesos / Mesosphere– a distributed system