Question 13 of 15 · CIE-1 QB · 7 marks
Open in ChatGPTExplain the difference between active replication and passive replication (primary-backup) in process resilience.
Introduction
Process resilience is built by running the same computation more than once. The two ways to organise those copies are active replication, where every copy processes every request, and passive replication, where one copy processes and the others stand by.
Active replication (state machine replication)
- The client multicasts each request to every replica.
- Every replica executes the request in the same order.
- Every replica sends its reply; the client takes the first and discards the rest.
Requirements and properties:
- Every replica must be deterministic, or the states diverge.
- The multicast must be totally ordered, so all replicas see requests in one order.
- A replica failure is invisible; the client simply needs one reply.
- Works for Byzantine faults too, if the replicas vote.
Passive replication (primary-backup)
- The client sends the request to the primary only.
- The primary executes, updates its state, and sends the new state or the update to the backups.
- The primary replies to the client.
- If the primary fails, a backup takes over from the last checkpoint it received and the clients are redirected.
Requirements and properties:
- The primary must keep the backups' state sufficiently fresh.
- Only one replica executes, so no determinism requirement.
- Recovery has a delay while a backup is promoted.
Diagram
Comparison
| Point | Active | Passive |
|---|---|---|
| Requests executed by | All replicas | Primary only |
| Determinism | Required | Not required |
| Message cost | One request to n replicas | One request plus n − 1 updates |
| Failover | Immediate | After promotion |
| Byzantine tolerance | Yes, with voting | Only if the primary is trusted |
| Best for | Small, deterministic services | Stateful services, databases |
Conclusion
Active replication gives instant failover and survives arbitrary faults but demands determinism and ordered multicast. Passive replication is cheaper on CPU and easy on non-deterministic code, but a failure costs a recovery pause while a backup is promoted.