Lecture 3: Primary-Backup — Whiteboard Descriptions
These are text descriptions of the whiteboard PDF from this lecture.
These materials were drafted by AI based on the live whiteboard PDF and audio transcript from the corresponding lecture and then reviewed and edited by course staff. They may contain errors. Please let us know if you spot any.
Replication
- Handle node failure — replication
Diagram: A Client sends requests (with sequence numbers) to two replicas, KV1 and KV2. Both replicas execute the same operations in the same order.
Deterministic State Machine
Also called "Application" in dslabs (AMO Application).
- Have state (possibly infinite)
- Take inputs ("Commands")
- Produce outputs ("Results")
- Deterministic: equal states on equal inputs produce equal outputs and next states
Primary Backup
- One replica is primary
- Primary decides what order
- Tell the backup what to do
Diagram: Two clients (C1, C2) send requests to the Primary (P). C1 sends reqA, C2 sends reqB. The Primary forwards requests to the Backup (B) with sequence numbers (reqA + seqnum). The Backup acknowledges (ack(seqnum)). After receiving the ack, the Primary sends the response back to the client (resp(A) to C1).
Failover Protocol
- Replacing one node with another in some role
- Ideally, detect the failure, then failover