SlideShare a Scribd company logo
1 of 22
Download to read offline
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

Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...GetInData
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsTyler Treat
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisZak Cole
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformJean-Paul Azar
 
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Svetlin Nakov
 
Blockchain Consensus Protocols
Blockchain Consensus ProtocolsBlockchain Consensus Protocols
Blockchain Consensus ProtocolsMelanie Swan
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using KafkaKnoldus Inc.
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservicespflueras
 
Blockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricBlockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricAraf Karsh Hamid
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsGautam Anand
 
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]Antonios Katsarakis
 
Distributed Tracing with Jaeger
Distributed Tracing with JaegerDistributed Tracing with Jaeger
Distributed Tracing with JaegerInho Kang
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in KafkaJayesh Thakrar
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Bitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & WalletsBitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & WalletsChristopher Allen
 

What's hot (20)

Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
 
From Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed SystemsFrom Mainframe to Microservice: An Introduction to Distributed Systems
From Mainframe to Microservice: An Introduction to Distributed Systems
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & Analysis
 
Kafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platformKafka Tutorial - basics of the Kafka streaming platform
Kafka Tutorial - basics of the Kafka streaming platform
 
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
 
Blockchain Consensus Protocols
Blockchain Consensus ProtocolsBlockchain Consensus Protocols
Blockchain Consensus Protocols
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Blockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricBlockchain - HyperLedger Fabric
Blockchain - HyperLedger Fabric
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
 
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]
Zeus: Locality-aware Distributed Transactions [Eurosys '21 presentation]
 
Distributed Tracing with Jaeger
Distributed Tracing with JaegerDistributed Tracing with Jaeger
Distributed Tracing with Jaeger
 
What's New in Apache Hive
What's New in Apache HiveWhat's New in Apache Hive
What's New in Apache Hive
 
Data Loss and Duplication in Kafka
Data Loss and Duplication in KafkaData Loss and Duplication in Kafka
Data Loss and Duplication in Kafka
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Bitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & WalletsBitcoin Keys, Addresses & Wallets
Bitcoin Keys, Addresses & Wallets
 

Viewers also liked

RAFT Consensus Algorithm
RAFT Consensus AlgorithmRAFT Consensus Algorithm
RAFT Consensus Algorithmsangyun han
 
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياه
ملتقى الصناع  هيا نصنع أردوينو وندخل إلى خفاياهملتقى الصناع  هيا نصنع أردوينو وندخل إلى خفاياه
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياهmuayyad alsadi
 
الاختيار بين التقنيات
الاختيار بين التقنياتالاختيار بين التقنيات
الاختيار بين التقنياتmuayyad alsadi
 
How to think like hardware hacker
How to think like hardware hackerHow to think like hardware hacker
How to think like hardware hackermuayyad alsadi
 
Algoritmos de Consenso: Paxos vs RAFT
Algoritmos de Consenso: Paxos vs RAFTAlgoritmos de Consenso: Paxos vs RAFT
Algoritmos de Consenso: Paxos vs RAFTMaycon Viana Bordin
 
2 research design
2 research design2 research design
2 research designusman nazir
 
Chicken buiscuit
Chicken buiscuitChicken buiscuit
Chicken buiscuitusman nazir
 
7 Biggest Divorce Mistakes
7 Biggest Divorce Mistakes7 Biggest Divorce Mistakes
7 Biggest Divorce MistakesJoryn Jenkins
 
20140517 なんでも勉強会 にゃんたこす_rev02
20140517 なんでも勉強会 にゃんたこす_rev0220140517 なんでも勉強会 にゃんたこす_rev02
20140517 なんでも勉強会 にゃんたこす_rev02Toshiaki Yamanishi
 
88 gibraltar investment presentation
88 gibraltar investment presentation88 gibraltar investment presentation
88 gibraltar investment presentation88gibraltar
 
쉐어몬스터 소개
쉐어몬스터 소개쉐어몬스터 소개
쉐어몬스터 소개윤근 강
 
88 Gibraltar Pricelist Tower 2
88 Gibraltar Pricelist Tower 288 Gibraltar Pricelist Tower 2
88 Gibraltar Pricelist Tower 288gibraltar
 

Viewers also liked (20)

RAFT Consensus Algorithm
RAFT Consensus AlgorithmRAFT Consensus Algorithm
RAFT Consensus Algorithm
 
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياه
ملتقى الصناع  هيا نصنع أردوينو وندخل إلى خفاياهملتقى الصناع  هيا نصنع أردوينو وندخل إلى خفاياه
ملتقى الصناع هيا نصنع أردوينو وندخل إلى خفاياه
 
الاختيار بين التقنيات
الاختيار بين التقنياتالاختيار بين التقنيات
الاختيار بين التقنيات
 
How to think like hardware hacker
How to think like hardware hackerHow to think like hardware hacker
How to think like hardware hacker
 
Algoritmos de Consenso: Paxos vs RAFT
Algoritmos de Consenso: Paxos vs RAFTAlgoritmos de Consenso: Paxos vs RAFT
Algoritmos de Consenso: Paxos vs RAFT
 
2 research design
2 research design2 research design
2 research design
 
Chicken buiscuit
Chicken buiscuitChicken buiscuit
Chicken buiscuit
 
7 Biggest Divorce Mistakes
7 Biggest Divorce Mistakes7 Biggest Divorce Mistakes
7 Biggest Divorce Mistakes
 
20140517 なんでも勉強会 にゃんたこす_rev02
20140517 なんでも勉強会 にゃんたこす_rev0220140517 なんでも勉強会 にゃんたこす_rev02
20140517 なんでも勉強会 にゃんたこす_rev02
 
88 gibraltar investment presentation
88 gibraltar investment presentation88 gibraltar investment presentation
88 gibraltar investment presentation
 
New design knowlege - Manzini
New design knowlege -  ManziniNew design knowlege -  Manzini
New design knowlege - Manzini
 
Wordle
WordleWordle
Wordle
 
Ovario poliquistico
Ovario poliquisticoOvario poliquistico
Ovario poliquistico
 
智慧城市
智慧城市智慧城市
智慧城市
 
Power system
Power systemPower system
Power system
 
쉐어몬스터 소개
쉐어몬스터 소개쉐어몬스터 소개
쉐어몬스터 소개
 
Cert Degree
Cert DegreeCert Degree
Cert Degree
 
av başladı
av başladıav başladı
av başladı
 
88 Gibraltar Pricelist Tower 2
88 Gibraltar Pricelist Tower 288 Gibraltar Pricelist Tower 2
88 Gibraltar Pricelist Tower 2
 
Sigil
SigilSigil
Sigil
 

Similar to Introduction to Raft algorithm

Raft_Diego_Ongaro.pdf
Raft_Diego_Ongaro.pdfRaft_Diego_Ongaro.pdf
Raft_Diego_Ongaro.pdfjsathy97
 
At8000 s configurando trunking
At8000 s configurando trunkingAt8000 s configurando trunking
At8000 s configurando trunkingNetPlus
 
2009-03-13 Atlanda System z Council Meeting
2009-03-13 Atlanda System z Council Meeting2009-03-13 Atlanda System z Council Meeting
2009-03-13 Atlanda System z Council MeetingShawn Wells
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinRabbitMQ Summit
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin Kuberton
 
Practical SPARQL Benchmarking Revisited
Practical SPARQL Benchmarking RevisitedPractical SPARQL Benchmarking Revisited
Practical SPARQL Benchmarking RevisitedRob Vesse
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On ConcurrencyWill Gage
 
M|18 Choosing the Right High Availability Strategy for You
M|18 Choosing the Right High Availability Strategy for YouM|18 Choosing the Right High Availability Strategy for You
M|18 Choosing the Right High Availability Strategy for YouMariaDB plc
 
Squash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSquash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSteve Arnold
 
Data Engineering for Data Scientists
Data Engineering for Data Scientists Data Engineering for Data Scientists
Data Engineering for Data Scientists jlacefie
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategyMariaDB plc
 
Fine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceFine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceVitor Oliveira
 
java.util.concurrent for Distributed Coordination, Riga DevDays 2019
java.util.concurrent for Distributed Coordination, Riga DevDays 2019java.util.concurrent for Distributed Coordination, Riga DevDays 2019
java.util.concurrent for Distributed Coordination, Riga DevDays 2019Ensar Basri Kahveci
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogJoe Stein
 

Similar to Introduction to Raft algorithm (20)

Raft_Diego_Ongaro.pdf
Raft_Diego_Ongaro.pdfRaft_Diego_Ongaro.pdf
Raft_Diego_Ongaro.pdf
 
Megastore by Google
Megastore by GoogleMegastore by Google
Megastore by Google
 
At8000 s configurando trunking
At8000 s configurando trunkingAt8000 s configurando trunking
At8000 s configurando trunking
 
2009-03-13 Atlanda System z Council Meeting
2009-03-13 Atlanda System z Council Meeting2009-03-13 Atlanda System z Council Meeting
2009-03-13 Atlanda System z Council Meeting
 
Exp2
Exp2Exp2
Exp2
 
An update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael KlishinAn update from the RabbitMQ team - Michael Klishin
An update from the RabbitMQ team - Michael Klishin
 
Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin  Monitoring&Logging - Stanislav Kolenkin
Monitoring&Logging - Stanislav Kolenkin
 
Practical SPARQL Benchmarking Revisited
Practical SPARQL Benchmarking RevisitedPractical SPARQL Benchmarking Revisited
Practical SPARQL Benchmarking Revisited
 
Shopzilla On Concurrency
Shopzilla On ConcurrencyShopzilla On Concurrency
Shopzilla On Concurrency
 
M|18 Choosing the Right High Availability Strategy for You
M|18 Choosing the Right High Availability Strategy for YouM|18 Choosing the Right High Availability Strategy for You
M|18 Choosing the Right High Availability Strategy for You
 
Squash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSquash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System Profile
 
Presto
PrestoPresto
Presto
 
CAP: Scaling, HA
CAP: Scaling, HACAP: Scaling, HA
CAP: Scaling, HA
 
Data Engineering for Data Scientists
Data Engineering for Data Scientists Data Engineering for Data Scientists
Data Engineering for Data Scientists
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
 
Fine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceFine-tuning Group Replication for Performance
Fine-tuning Group Replication for Performance
 
java.util.concurrent for Distributed Coordination, Riga DevDays 2019
java.util.concurrent for Distributed Coordination, Riga DevDays 2019java.util.concurrent for Distributed Coordination, Riga DevDays 2019
java.util.concurrent for Distributed Coordination, Riga DevDays 2019
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit Log
 
Rfc1058
Rfc1058Rfc1058
Rfc1058
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

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