C2 F1 F1 Leader Election t(ms) 0 200 400 600 800 1000 Request Vote 150ms Request Vote (Fails) One follower becomes a candidate after an election timeout and requests votes
C2 F1 C2 Leader Election t(ms) 0 200 400 600 800 1000 F1 Request Vote Request Vote 150ms Two followers become candidates simultaneously and begin requesting votes
C2 F2 C2 Leader Election t(ms) 0 200 400 600 800 1000 F2 Vote Granted Vote Granted 155ms Each candidate receives a vote from themselves and from one peer
L3 F3 C2 Leader Election t(ms) 0 200 400 600 800 1000 F3 305ms Vote Granted Vote Granted Candidate receives vote from itself and two peer votes so it becomes leader for election term #3
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 20ms <“”> <“”> <“”> 1 “sally” 1 “sally” 1 “sally” Append Entries Append Entries At the next heartbeat, the log entry is replicated to followers
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 OK <“sally”> <“”> <“”> 1 “sally” 1 “sally” 1 “sally” 22ms A majority of nodes have written the log entry written to disk so it becomes committed
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 <“sally”> <“sally”> <“sally”> 1 “sally” 1 “sally” 1 “sally” Append Entries Append Entries 60ms At the next heartbeat, no new log information is sent
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 1 “sally” 2 “bob” 1 “sally” 1 “sally” <“sally”> <“sally”> <“sally”> 75ms A new uncommitted log entry is added to the leader
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 <“sally”> <“sally”> <“sally”> 1 “sally” 2 “bob” 1 “sally” 2 “bob” 1 “sally” 2 “bob” Append Entries Append Entries 80ms At the next heartbeat, the entry is replicated to the followers
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 OK <“bob”> <“sally”> <“sally”> 1 “sally” 2 “bob” 1 “sally” 1 “sally” OK 82ms The entry is committed once the followers acknowledge the request
L1 F1 F1 Log Replication t(ms) 0 200 400 600 800 1000 <“bob”> <“bob”> <“bob”> 1 “sally” 2 “bob” 1 “sally” 2 “bob” 1 “sally” 2 “bob” Append Entries Append Entries 100ms At the next heartbeat, the leader notifies the followers of the new committed entry
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 20ms 1 “sally” 1 “sally” <“”> <“”> F1 1 “sally” <“”> F1 1 “sally” <“”> F1 1 “sally” <“”> Append Entries On the next heartbeat, the entry is replicated to the followers
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 25ms 1 “sally” 1 “sally” <“sally”> <“”> F1 1 “sally” <“”> F1 1 “sally” <“”> F1 1 “sally” <“”> OK The followers acknowledge the entry and the entry is committed
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 40ms 1 “sally” 1 “sally” <“sally”> <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> Append Entries On the next heartbeat, the committed entry is replicated to the followers
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 1 “sally” 1 “sally” <“sally”> <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> A network partition makes a majority of nodes inaccessible from the leader 60ms
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 1 “sally” 2 “bob” 1 “sally” <“sally”> <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> A new log entry is added to the leader 70ms
L1 F1 Log Replication t(ms) 0 200 400 600 800 1000 1 “sally” 2 “bob” 1 “sally” 2 “bob” <“sally”> <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> F1 1 “sally” <“sally”> The follower acknowledges the entry but there is not a quorum OK 85ms
Image Attribution Database designed by Sergey Shmidt from The Noun Project Question designed by Greg Pabst from The Noun Project Lock from The Noun Project Floppy Disk designed by Mike Wirth from The Noun Project Movie designed by Anna Weiss from The Noun Project