CLOUD CONCEPT

Failover

Failover is the transfer of traffic or processing from a failed or unhealthy resource to a healthy alternative so a service can continue operating.

Cloud Concepts Hub →

What is Failover

Failover uses redundant resources, health detection, and a mechanism for transferring work to reduce interruptions when components fail. In cloud architectures, distributing those resources across multiple Availability Zones helps maintain availability when an instance or an entire zone becomes unavailable.

Failover is a recovery mechanism that transfers responsibility from an unavailable or unhealthy component to another component capable of doing its work. The component might be an application server, database, network endpoint, or an entire deployment. Failover supports high availability by reducing the time a service remains unavailable after a failure. High availability is the objective; failover is one mechanism used to achieve it.

A practical failover design requires more than a spare server. It needs a way to detect failure, a healthy alternative with sufficient capacity, and a mechanism to redirect traffic or transfer processing responsibility. Health checks should reflect whether a component can perform useful work, not merely whether its operating system responds. Detection thresholds must balance fast recovery against unnecessary transfers caused by temporary network problems or brief performance slowdowns.

In AWS, a Region contains multiple Availability Zones, and each Availability Zone consists of one or more discrete data centers with independent power, networking, and connectivity. Deploying application instances across multiple Availability Zones reduces exposure to a single zone failure. For example, a web application can run instances in two zones behind a load balancer. If instances in one zone become unhealthy, the load balancer can direct new requests to healthy instances in the other zone. Multiple instances located only in one zone do not provide the same protection against a zone-wide disruption.

Application availability also depends on the data tier and other dependencies. A web tier distributed across zones can still become unavailable if it depends on a single database without a recovery alternative. A database failover design typically replicates data to another database resource and promotes or selects an eligible replica when the primary fails. Applications must handle broken connections, reconnect to the appropriate endpoint, and retry operations safely. Keeping user sessions only in an individual application server's memory can also interrupt users when traffic moves elsewhere.

Active-passive designs keep an alternative ready to take over, while active-active designs serve traffic from multiple resources and shift work to surviving resources after a failure. Either approach requires enough surviving capacity to handle the expected workload. Automatic scaling can replenish capacity, but provisioning takes time and should not be treated as instant protection against a sudden zone failure.

Failover involves cost and consistency trade-offs. Redundant capacity, data replication, monitoring, and testing increase expense and operational complexity. Asynchronous replication can leave a promoted replica missing recent writes. Synchronous replication can reduce that risk but adds coordination and latency. Recovery time objective describes the target time to restore service, while recovery point objective describes the acceptable amount of data loss measured in time.

Failover does not necessarily preserve existing connections, guarantee zero downtime, or protect against every failure. Multi-zone deployment addresses zone-level failures within a Region; protection against a regional outage requires a separate cross-Region strategy. Backups support restoration but do not, by themselves, provide a ready failover destination. Test failure scenarios regularly, prevent multiple nodes from incorrectly acting as the sole writer, and plan failback—the controlled return to the preferred resource after recovery.

Key aspects of Failover

Effective failover combines independent redundant resources, reliable health detection, sufficient capacity, consistent data handling, and tested recovery procedures.

Failure detection and transfer

Health checks or monitoring identify when a resource cannot serve its workload, and routing or orchestration moves work to an alternative. Configure thresholds to avoid both slow recovery and unnecessary failovers.

Independent failure domains

Place redundant resources across multiple Availability Zones to reduce dependence on one zone's infrastructure. Verify that databases and other critical dependencies have equivalent protection.

Ready capacity

Surviving resources must have enough capacity to accept transferred work. Reserve headroom or maintain suitable standby capacity rather than relying entirely on resources that must be provisioned after failure.

State and data continuity

Replicate required data and avoid storing essential session state only on a single application instance. Understand replication lag, write ownership, and the possibility of data loss during promotion.

Application recovery behavior

Applications must reconnect after endpoint or connection changes and use bounded retries with backoff. Make retried writes idempotent where possible so recovery does not create duplicate transactions.

Testing and controlled failback

Exercise failover under realistic load and measure recovery time and data loss against objectives. Return traffic to recovered resources only after validating their health and data consistency.

Cloud services for Failover

Elastic Load Balancing directs application traffic to healthy targets distributed across Availability Zones, while Amazon EC2 Auto Scaling maintains and replenishes the underlying instance capacity. Amazon RDS Multi-AZ deployments provide database redundancy and managed failover, but applications still need connection recovery and safe retry logic. Amazon Route 53 can provide DNS-level failover between separate endpoints, including deployments in different Regions when the architecture supports it. Together, these services address different layers of availability; they still require compatible data replication, sufficient surviving capacity, and tested end-to-end recovery procedures.

Amazon RDS image Amazon RDS

Amazon RDS supports managed database failover through Multi-AZ deployments. In a Multi-AZ DB instance deployment, RDS synchronously replicates to a standby in another Availability Zone and can automatically fail over to it; that standby does not serve read traffic.

Open Amazon RDS →
Amazon EC2 Auto Scaling image Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling maintains desired instance capacity and replaces unhealthy instances. An Auto Scaling group spanning multiple Availability Zones complements traffic failover by maintaining and replenishing compute capacity, although instance launch and application startup take time.

Open Amazon EC2 Auto Scaling →
Amazon Route 53 image Amazon Route 53

Amazon Route 53 supports DNS failover routing that can return a secondary endpoint when the primary is considered unhealthy. Recovery is affected by health evaluation, DNS caching, and client behavior, so it does not immediately move every client or preserve existing connections.

Open Amazon Route 53 →