Skip to main content

Passive vs active replication; availability

Short answer

Passive replication has a primary execute and push updates; active replication uses total-order multicast to all replicas, which all execute. Passive allows non-determinism and failover; active masks failures instantly but needs determinism. High availability uses replication with primary-backup failover and leader election.

Compare/differentiate passive replication with active replication approach. Also discuss with a technique that makes the distributed system service highly available.

Passive vs active replication

PointPassive (primary-backup)Active (state machine)
Who processes the requestOnly the primary replica managerAll replica managers
BackupsReceive state updates from the primaryExecute the same requests independently
Front end talks toPrimary (one RM)Group of RMs by multicast
CommunicationPrimary sends updates to backups; ordering by primaryTotally ordered reliable multicast
Failure handlingFailover: a backup is elected to replace primary; short delayImmediate masking; no recovery delay
Non-deterministic operationsAllowed (the primary decides outcome)Not allowed, replicas would diverge
Failure typesCrash failures onlyCan tolerate Byzantine failures with voting
Resource usageLow: work done onceHigh: work done n times
ConsistencyLinearizable if primary worksSequentially consistent
ExamplePrimary-backup databaseReplicated state machines, fault-tolerant control

A technique for high availability

Replication with failover and failure detection, e.g. primary-backup with an election.

  1. Keep the service data on several servers at different locations; a front end routes client requests to the primary.
  2. The primary applies each update and forwards it to the backups, replying to the client only after backups acknowledge (so no update is lost).
  3. Backups and the primary exchange heartbeats. If the primary stops, a backup is chosen as the new primary by a leader election (bully algorithm); the front end redirects clients to it.
  4. A repaired server rejoins as backup after copying the current state.
  5. Load balancers and multiple front ends remove other single points of failure.

If each of n replicas is down with probability p independently, the service is available with probability 1 − pⁿ; for p = 0.05, n = 3 it is 99.9875%.

Alternative: the gossip architecture, where any replica answers a client and updates are propagated lazily.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 7 questions →