Log replication copies an ordered sequence of operations across nodes. Unlike state-based replication, which sends the current state or a diff, it sends the operations that produced that state. With deterministic state machines, replicas starting alike and applying identical operations in identical order reach the same result. section 8.4.4 section 10.8
A useful system model separates the replicated log from the application state machine:
- A leader accepts client operations and propagates log entries to the other nodes. section 10.6.2
- After an entry is committed, the platform-level protocol hands it to the application-level state machine, which applies it. section 10.6.1
- In Raft, each term begins with leader election and continues with log replication; term numbers reject messages from older leaders. section 10.6.2
A counter replicated by operations
A counter begins at zero and receives increment-by(2), followed by increment-by(3). State-based replication might send counter = 2 and counter = 5; log-based replication sends the two operations. Every deterministic replica can therefore reproduce the same final state by applying the same sequence. section 8.4.4
Figure 10.3 Raft’s log abstraction
Use the Raft log abstraction to connect committed entries with safe application to the replicated state machine. section 10.6.1
Figure 10.4 The Raft consensus protocol advances in terms, with each term consisting of a leader-election phase and a log-replication phase.
Use the term diagram to visualize how Raft alternates leader election with log replication. section 10.6.2
