CSE446 Lecture 5
CSE446 Lecture 5
Properties Note
A consensus protocol is considered safe (or
consistent) only when all nodes produce the same
Safety/ Consistency
valid output, according to the protocol rules, for the
same atomic broadcast
Liveness/ If all non-faulty participating nodes produce an output
availability the protocol is considered live
It exhibits the network’s capability to perform as
Fault Tolerance
intended in the midst of node failures
FLP Impossibility
• A well-known theorem*, by Fischer, Lynch and Paterson, called
FLP Impossibility has shown that
• a deterministic consensus protocol cannot satisfy all three
properties in an asynchronous network
• Safety and liveness are favoured over fault tolerance in the
domain of distributed system applications
*M. J. Fischer, N. A. Lynch, and M. S. Paterson. “Impossibility of distributed consensus with one faulty process”. Journal of the
ACM (JACM), 32(2):374382, 1985
CAP Theorem
Pick any two
might be dropped
*Brewer, E. A. “Towards robust distributed systems.”. In PODC (Vol. 7), July
2000.
Crash-tolerant consensus algorithm
• Algorithms belonging to this class aim to guarantee the atomic
broadcast (total order) of messages within the participating nodes
in the presence of certain number of node failures
• These algorithms utilise the notion of views or epochs
• which imply a certain duration of time
• A leader is selected for each epoch who takes decisions regarding
the atomic broadcast, and all other nodes comply with its decision
• In case a leader fails due to a crash failure, the protocols elect a
new leader to function
Crash-tolerant consensus algorithm
• The best known algorithms belonging to this class can
continue to function if the following condition holds:
• f < n/2 where f is the number of faulty nodes and n is the total
number of participating nodes
• Examples of some well-known crash-tolerant consensus
protocol are
• Paxos, Viewstamped Replication, ZooKeeper, and Raft
RAFT
• Raft is a distributed consensus algorithm
• It solves the problem of getting multiple servers to agree on a
shared state even in the face of failures
• The shared status is usually a data structure supported by a
replicated log
• We need the system to be fully operational as long as a
majority of the servers are up
RAFT
• Raft works by electing a leader in the cluster
• The leader is responsible for accepting client requests and managing
the replication of the log to other servers
• The data flows only in one direction: leader -> other servers
• Raft decomposes consensus into three sub-problems
• Leader Election: A new leader needs to be elected in case of the failure of
an existing one
• Log replication: The leader needs to keep the logs of all servers in sync with
its own through replication
• Safety: to ensure consistency across all nodes
https://media.geeksforgeeks.org/wp-content/uploads/raft-leader-election.png
RAFT: log replication
• A client communicates with the leader to update the log (append to the
log)
• The leader updates its log entry and replicates the value to the followers
• Each follower updates their log entries and replies back to the leader
• The leader commits the value to the log if the majority of the nodes reply
back
• The leader replicates this commitment to the followers and they also
commit the value
https://media.geeksforgeeks.org/wp-content/uploads/pbft-algorithm-communication-visual.png
https://media.tenor.com/Wkb4VlC1BHoAAAAC/money-money-rain.gif
https://media3.giphy.com/media/JpG2A9P3dPHXaTYrwu/giphy.gif?cid=ecf05e4785vmquns0oo0f7x59qjgnyjx467oxq37irfv5z
7d&rid=giphy.gif&ct=g
Money, money, money…..its history
• Money is a medium of exchange
• Stands in for an arbitrarily long
chain of barter
• exchanging goods or services for
other goods or services without
using a monetary unit
• Widely accepted
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQYxR436ZDwa3q4h4ZjEyMG_DC43xj4Y4HpUdeUZjnErNqZ2UdeuQ
Money, money, money…..its history
https://i.pinimg.com/originals/86/e9/d2/86e9d2574fef064
1d2a70ca3ec25141f.png
Money, money, money…..its history
https://i.pinimg.com/originals/86/e9/d2/86e9d2574fef064
1d2a70ca3ec25141f.png
Properties of money
• Money is a unit of account
• a nominal monetary unit of measure
used to represent the real value (or
cost) of any economic item; i.e. goods,
services, assets, liabilities, income,
expenses.
• Money is a store of value
https://upload.wikimedia.org/wikipedia/commons/e/e3/Gold-
• Recognisable 295936.jpg