100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What is Active-Passive Failover?

Understand active-passive failover: health checks, replication modes, promotion, and how it compares to active-active.

mediumQ223 of 224 in System Design Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

Active-passive failover is a reliability pattern where one instance (the active node) handles all live traffic while one or more standby instances (passive nodes) stay ready to take over automatically if the active node fails, minimizing downtime without needing every node to serve traffic simultaneously.

The active node processes all reads and writes while passive nodes continuously replicate its state, either synchronously (zero data loss but higher write latency) or asynchronously (lower latency but a small window of potential data loss). A health-checking mechanism, such as a heartbeat monitor or watchdog, continuously verifies the active node is alive; when it stops responding, a failover process promotes a passive node to active, updates DNS or a virtual IP/load balancer to redirect traffic, and the new active node begins serving requests. Failover can be manual (an operator triggers it after confirming the outage) or automatic (a consensus mechanism like a leader election protocol detects failure and promotes a replica without human intervention). The trade-off versus active-active is simplicity — no conflict resolution needed since only one node ever writes — at the cost of wasting the passive node’s capacity during normal operation and incurring some downtime during the failover window itself.

  • Simple to reason about since only one node accepts writes at any time, avoiding conflict resolution
  • Provides automatic recovery from a node or data center failure without manual data reconciliation
  • Keeps a warm, replicated standby ready so recovery time is much faster than restoring from backup
  • Well suited to workloads that need strong consistency without the complexity of multi-master writes

AI Mentor Explanation

Active-passive failover is like a team keeping its designated vice-captain on the field at all times, fully briefed and ready, while the captain makes every decision during play. If the captain is suddenly injured, the vice-captain steps in immediately and the game continues without needing a time-out to appoint someone new. The vice-captain does not make calls while the captain is fine — they simply shadow every decision so they are instantly ready. That standby readiness, activated only on failure, is exactly what active-passive failover provides for a system.

Step-by-Step Explanation

  1. Step 1

    Active node serves all traffic

    One primary instance handles every read and write while passive standbys stay idle for client traffic.

  2. Step 2

    Continuous replication to standby

    The active node's state is replicated to passive nodes synchronously or asynchronously so they stay near up to date.

  3. Step 3

    Health monitoring detects failure

    A heartbeat or watchdog mechanism continuously checks the active node and flags it as down after missed checks.

  4. Step 4

    Promote and redirect traffic

    A passive node is promoted to active, and DNS, a virtual IP, or a load balancer is updated to route traffic to the new active node.

What Interviewer Expects

  • Explains the roles of active vs passive nodes and that only the active node serves writes
  • Mentions synchronous vs asynchronous replication and the data-loss trade-off on failover
  • Describes health checking/heartbeat and the promotion + traffic redirection mechanism
  • Compares to active-active and names the simplicity vs wasted-capacity trade-off

Common Mistakes

  • Assuming failover is instantaneous with zero downtime in every case
  • Not distinguishing manual failover from automatic failover with leader election
  • Forgetting that asynchronous replication can lose the last few writes on failover
  • Confusing active-passive with load balancing across multiple active nodes

Best Answer (HR Friendly)

Active-passive failover means one server handles all the real traffic while a backup server quietly stays in sync in the background, ready to take over. If the primary server goes down, the system detects it and switches traffic to the backup automatically, so the outage is much shorter than if you had to restore everything from scratch.

Code Example

Active-passive failover config (illustrative)
cluster:
  nodes:
    - id: node-a
      role: active
      region: us-east
    - id: node-b
      role: passive
      region: us-west
      replicationMode: async
  healthCheck:
    intervalSeconds: 5
    timeoutSeconds: 3
    failureThreshold: 3
  failoverPolicy:
    mode: automatic
    promote: node-b
    updateDns: true
    dnsTtlSeconds: 30

Follow-up Questions

  • How would you detect a “split-brain” situation where both nodes think they are active?
  • What is the difference between manual and automatic failover, and when would you prefer each?
  • How does synchronous replication reduce data loss risk during failover, and what does it cost?
  • How would you test that failover actually works before you need it in production?

MCQ Practice

1. In active-passive failover, which node handles write traffic during normal operation?

The active node is the sole handler of writes; passive nodes replicate its state but do not accept client writes.

2. What risk does asynchronous replication introduce in an active-passive setup?

Because replication happens after the write is acknowledged, any writes not yet propagated are lost if the active node fails before replicating.

3. "Split-brain" in a failover cluster refers to what situation?

Split-brain happens when a network partition causes both nodes to believe they are active, risking conflicting, diverging writes.

Flash Cards

What is active-passive failover?A pattern where one active node serves traffic while a synced standby takes over automatically if it fails.

How does the system detect the active node has failed?A heartbeat or watchdog health check that flags the node down after repeated missed checks.

What is split-brain?A failure mode where two nodes both believe they are active and accept conflicting writes.

Active-passive vs active-active?Active-passive is simpler (no write conflicts) but wastes standby capacity; active-active uses all capacity but needs conflict resolution.

1 / 4

Continue Learning