Hot standby is a redundancy configuration in which a secondary server runs continuously, receives a near-real-time copy of state from the primary and is ready to take over its workload within seconds to a few minutes. In server reliability, it is the fastest form of the active-passive model: the backup is powered on, booted, loaded with current data and monitored, but it does not serve production traffic until a failover occurs.
Hot standby exists to shrink two numbers that define recovery: the recovery time objective (RTO), how long a service may be down, and the recovery point objective (RPO), how much recent data may be lost. It costs nearly as much as a second production system, so it is reserved for services where minutes of downtime are expensive.
How a hot standby stays ready
A hot standby depends on three continuous processes: state replication, health monitoring and a failover mechanism. Replication keeps the standby’s data current, monitoring detects when the primary has failed, and the failover step redirects clients to the standby, usually by moving a virtual IP address, updating DNS or reconfiguring a load balancer.
Replication can be synchronous or asynchronous. With synchronous replication, the primary confirms a write only after the standby has stored it, which gives an RPO of zero at the price of added write latency. With asynchronous replication, the primary confirms immediately and ships changes afterward, so a sudden failure can lose the last milliseconds to seconds of transactions.
The table below lists the building blocks and the technologies commonly used for each.
| Building block | Purpose | Common examples |
|---|---|---|
| State replication | Keeps standby data current | Database streaming replication, block-level mirroring |
| Heartbeat monitoring | Detects primary failure | Heartbeat messages every 1-5 s, cluster managers |
| Fencing | Prevents the failed primary from writing | Power fencing, storage reservations, STONITH |
| Traffic redirection | Sends clients to the standby | Virtual IP takeover, DNS change, load balancer pool |
| Promotion logic | Turns the standby into the new primary | Cluster resource manager, orchestration script |
Hot, warm and cold standby compared
Standby configurations differ mainly in how much of the backup is already running before a failure. The more preparation is done in advance, the shorter the recovery and the higher the ongoing cost. The following comparison shows typical values; actual figures depend on data volume, automation and testing.
| Standby level | State of the backup | Typical RTO | Typical RPO | Relative cost |
|---|---|---|---|---|
| Hot standby | Running, synchronized, monitored | Seconds to minutes | Zero to seconds | High |
| Warm standby | Running, periodically updated | Minutes to an hour | Minutes to hours | Medium |
| Cold standby | Off or not provisioned | Hours to days | Last backup | Low |
A hot standby also differs from active-active operation. In active-active, every node serves traffic at all times, so capacity is used fully and failure merely reduces it. In hot standby, the backup is idle capacity, which is simpler to reason about because only one node writes at a time and there are no conflicting updates.
Failover sequence and timing
Failover to a hot standby is a short sequence of steps, and each step adds to the total RTO. Teams that measure each phase separately usually find that detection and redirection, not promotion, dominate the outage.
| Phase | What happens | Typical duration |
|---|---|---|
| Detection | Missed heartbeats exceed a threshold | 3-30 s |
| Fencing | The old primary is isolated or powered off | 1-15 s |
| Promotion | The standby becomes writable | 1-10 s |
| Redirection | Clients reach the new primary | Seconds with virtual IP, longer with DNS |
| Warm-up | Caches and connection pools refill | Seconds to minutes |
Detection thresholds involve a direct trade-off. A short timeout shortens recovery but risks false failovers during brief network hiccups or garbage collection pauses; a long timeout avoids unnecessary switches but lengthens real outages. Most production clusters require several consecutive missed heartbeats before acting.
Design decisions for a hot standby
Building a reliable hot standby is mostly a matter of removing hidden dependencies between the primary and the backup. A standby in the same rack, on the same power feed or behind the same switch shares the primary’s failure modes and offers little protection.
| Requirement | Recommended choice | Reason |
|---|---|---|
| No data loss allowed | Synchronous replication | Every committed write exists on both nodes |
| Low write latency across regions | Asynchronous replication | Avoids waiting for a distant acknowledgment |
| Fast client redirection | Virtual IP or load balancer | Avoids DNS cache delays |
| Protection against site failure | Standby in another zone or site | Removes shared power and network |
| Avoiding two active writers | Mandatory fencing and quorum | Prevents split-brain corruption |
Capacity is another decision. The standby must be sized like the primary, because after failover it carries the full load. A smaller standby can save money but turns a failover into a performance incident instead of a recovery.
Risks and common mistakes
The most serious hot standby risk is split-brain, a state in which both nodes believe they are primary and accept writes, leaving two divergent copies of data. It usually follows a network partition between nodes that are both still healthy, which is why fencing and quorum are essential rather than optional.
- Untested failover: a standby that has never been promoted in a drill often fails on expired credentials, missing configuration or outdated software.
- Replication lag left unmonitored: an asynchronous standby that falls minutes behind silently raises the real RPO.
- Configuration drift: patches, kernel parameters or application versions applied only to the primary make the standby behave differently.
- Shared single points of failure: common storage, network paths or authentication services can take down both nodes together.
- No failback plan: after recovery, returning to the original primary needs its own replication and a planned maintenance window.
Regular failover drills, ideally during planned maintenance and later as part of chaos engineering practice, are the only reliable proof that the standby actually meets its RTO and RPO targets.
A plain-language summary
Think of a hot standby as a second pilot already seated in the cockpit with the same instruments in view. The second pilot does not fly the plane during a normal trip but follows everything that happens. If the first pilot becomes unable to continue, the second takes the controls almost immediately, without needing to catch up.
For servers, this means a backup machine is switched on and keeps an up-to-date copy of all data. When the main machine fails, the backup takes over within seconds or minutes. The trade-off is clear: you pay for a second machine that mostly waits, in exchange for very short interruptions.
An example from practice
A regional payment processor runs its transaction database on a primary server in one data center zone and a hot standby in a second zone about 30 kilometers away. Streaming replication is synchronous, so every confirmed payment exists on both servers, and the network round trip adds roughly one millisecond per commit.
A cluster manager sends heartbeats every two seconds and declares failure after five missed beats. One evening, a power distribution fault takes the primary zone offline. Within ten seconds the cluster fences the old primary through its out-of-band management interface, promotes the standby and moves the virtual IP address used by the application servers.
Payment terminals see about twenty-five seconds of failed requests, which they retry automatically. No confirmed transaction is lost, and the team later rebuilds the original server as the new standby during a scheduled maintenance window.