Skip to the guide

Redundancy and failover

IntermediateConcept3 pages

Redundancy means keeping more than one of everything that matters. Failover is switching to the spare when the active copy fails. Interviewers expect both in every design, and they test the details: how the failure is noticed, how long the switch takes, whether the spares can carry the load, and what stops the old copy coming back as a second leader.

The understudy

An hour before curtain, a theatre's lead actor falls ill. The understudy has learned every line and watched every performance. The stage manager decides the lead can't go on, the understudy goes on, and an announcement tells the audience. If the lead feels better at the interval, he doesn't walk back on: one Hamlet per performance. A small touring company with no understudy simply cancels.

  • the lead actor → the active copy, such as the database leader
  • the understudy → a standby: a spare copy ready to take over
  • learning every line → replication: the spare keeps its copy of the state up to date
  • the stage manager's call → detecting the failure and deciding to switch
  • the announcement to the audience → redirecting clients to the new copy
  • one Hamlet → fencing: the old copy must not act once replaced
  • cancelling → a single point of failure