Study notesWeek 4: Agreement Without A Boss
Week 4

Agreement Without A Boss

Outcomes

What You Can Do By The End

The problem

Why Agreement Is Hard

Definition

Three Properties Of Consensus

What cannot be done

The FLP Limit

Why we need it

Replicated State Machines

log:  [1: set x=5] [2: add x,2] [3: set y=1]
A:    x=7, y=1
B:    x=7, y=1
C:    x=7, y=1
The key trick

Majority Quorums

machines: A B C D E
group 1:  A B C
group 2:  C D E
overlap:  C
Crash faults

How Many Machines Do You Need?

for n in range(3, 8):
    f = (n - 1) // 2
    print(n, 'machines survive', f, 'crashes')
Lamport

Paxos: The Original

Ongaro and Ousterhout, 2014

Raft: Three Roles

follower --timeout--> candidate
candidate --majority--> leader
leader --sees higher term--> follower
Normal operation

Raft: Replicating The Log

Lamport, Shostak, Pease, 1982

Byzantine Generals

Exact result

The 3F+1 Rule

0471115471013f = 1f = 2f = 3f = 4
for f in range(1, 5):
    print('tolerate', f, 'liars: need', 3 * f + 1, 'machines')
PBFT and beyond

Byzantine Fault Tolerant Protocols

Decision guide

Choosing A Design

ProtocolFaultsMachines
PaxosCrashes2f + 1
RaftCrashes2f + 1
PBFTLying nodes too3f + 1
Summary

Recap

Week 5

Next Week

Your turn

Questions And Exercise