Active-passive

On this page 7

Active-passive is a high availability architecture in which one node serves all production traffic while one or more standby nodes stay idle or semi-idle, ready to take over through failover when the active node fails. In the reliability practice of servers, it is the most common way to remove a single point of failure without changing how the application itself handles requests.

The design trades unused standby capacity for simplicity: because only one node writes data or accepts sessions at a time, it avoids most of the consistency problems that make multi-writer systems difficult. Its effectiveness depends almost entirely on how quickly and safely the standby can detect failure and assume the active role.

How an active-passive cluster operates

An active-passive cluster consists of an active node, at least one passive node, a mechanism that keeps state synchronized between them, and a health monitoring layer that decides when to switch. Clients reach the service through a stable endpoint, typically a floating virtual IP, a DNS name or a load balancer target, so that a failover does not require client reconfiguration.

The passive node continuously receives data from the active one through replication: database log shipping, block-level storage replication, or a shared storage volume that only one node mounts at a time. Health checks, often implemented as heartbeat messages every one to a few seconds, tell the passive node whether its partner is alive.

The following table summarizes the components and the role each plays.

ComponentRoleTypical implementation
Active nodeServes all reads and writesPrimary database or application server
Passive nodeHolds synchronized state, stays readyReplica or standby server
Replication channelCopies data from active to passiveLog shipping, DRBD, storage mirroring
Heartbeat and monitorDetects failure of the active nodeCorosync, keepalived, cloud health checks
Client endpointHides which node is activeVirtual IP, DNS record, load balancer
Core components of an active-passive setup

Standby temperature and its effect on recovery

Active-passive designs differ mainly in how ready the passive node is, often described as its temperature. The warmer the standby, the shorter the recovery time objective (RTO), and the higher the cost of keeping it running.

VariantState of passive nodeTypical RTORelative cost
Hot standbyRunning, data replicated continuouslySeconds to about one minuteHigh
Warm standbyRunning at reduced scale or partly loadedMinutesMedium
Cold standbyProvisioned but stopped, restored from backupHoursLow
Standby variants and typical recovery characteristics

The recovery point objective (RPO) depends on the replication mode rather than the temperature. Synchronous replication confirms each write on both nodes and can achieve an RPO of zero, at the cost of added write latency. Asynchronous replication keeps writes fast but may lose the last seconds of transactions when the active node fails abruptly.

Active-passive compared with active-active

The main alternative is active-active, where every node serves traffic simultaneously. Choosing between them is a question of consistency requirements, budget and operational maturity, not of one design being universally better.

AspectActive-passiveActive-active
Capacity useStandby resources mostly idleAll nodes carry load
Data consistencySingle writer, simpleConflict handling or coordination required
Failover impactBrief interruption during switchRemaining nodes absorb load
ScalingLimited to one node’s capacityScales horizontally
Operational complexityLowerHigher
Active-passive and active-active compared

Active-passive remains the default for stateful systems with a single writer, such as relational databases, message brokers and file servers. Active-active fits stateless web tiers and globally distributed services, where the extra complexity buys both capacity and availability.

Failover, fencing and split-brain prevention

The most dangerous failure in an active-passive cluster is split-brain: both nodes believe they are active and accept writes independently, which corrupts or diverges data. It usually happens when the heartbeat network fails while both nodes remain healthy.

Mature clusters prevent split-brain with two mechanisms. Quorum requires a majority vote, often supplied by a third witness node or arbiter, before any node may become active. Fencing, also called STONITH (shoot the other node in the head), forcibly powers off or isolates the old active node through an out-of-band interface before the passive node takes over.

  • Automatic failover reduces downtime but must be tuned to avoid flapping on transient network glitches.
  • Manual failover gives operators control and suits systems where a false switch is costlier than a few minutes of delay.
  • Failback to the original node should be a deliberate, planned operation, not an automatic reflex.

Limitations and common mistakes

An active-passive design only delivers its promised uptime when the standby is regularly proven to work. Many outages occur precisely at failover, because the passive path was never exercised.

MistakeConsequenceRemedy
Untested standbyFailover fails when neededScheduled failover drills or chaos engineering
Shared dependencyBoth nodes fail togetherSeparate power, network and storage paths
No fencingSplit-brain and data divergenceConfigure STONITH and quorum
Configuration driftStandby cannot run current releaseDeploy to both nodes from one pipeline
Undersized standbyDegraded service after switchMatch passive capacity to peak load
Frequent active-passive mistakes and their remedies

A further limitation is cost efficiency: an idle hot standby doubles infrastructure spend for a node that serves no traffic most of the time. Some teams offset this by sending read-only queries or backups to the replica, which preserves the single-writer model while putting the standby to use.

A plain-language summary

Active-passive works like a backup goalkeeper sitting on the bench in full kit. Only one goalkeeper plays at a time, but if the first one is injured, the second steps in within moments and the match continues.

The bench player costs money while doing nothing most of the time. The payoff is that the game never stops for long when something goes wrong, and there is never confusion about who is guarding the goal.

An example from practice

A regional online retailer runs its order database as an active-passive PostgreSQL pair in two availability zones. The primary handles every order; a hot standby receives the write-ahead log through synchronous streaming replication, so no confirmed order can be lost. A cluster manager monitors both nodes with heartbeats every two seconds, and a small witness node in a third zone provides quorum.

One evening the primary’s storage controller fails. Within about 30 seconds, the cluster manager fences the old primary, promotes the standby and moves the virtual IP. Shoppers see a short pause at checkout, and the team confirms an RPO of zero and an RTO under one minute. The failed node is repaired the next morning and rejoins as the new standby during a planned maintenance window.