Lesson 1 of 4 High Availability and Disaster Recovery

Designing Fault-Tolerant Multi-AZ Environments

This lesson explains how running every tier across at least two Availability Zones without single points of failure forms the foundation of high availability on AWS.

Learning outcomes

After completing this lesson, you will be able to:

  • Eliminate single points of failure in each tier.
  • Make instances stateless and decouple components.
  • Use Elastic IP addresses appropriately.
  • Size capacity to survive the loss of an Availability Zone.

Eliminating single points of failure

Each tier of an application must survive the loss of an instance and of an AZ. The web and application tiers run in Auto Scaling groups across multiple AZs behind a load balancer, with capacity in each AZ sufficient to carry the load if one AZ fails (static stability). The data tier uses Multi-AZ RDS, Aurora with replicas in other AZs, DynamoDB (multi-AZ by design), ElastiCache with Multi-AZ failover, and EFS Regional file systems. Networking uses a NAT gateway in each AZ with per-AZ route tables, or a regional NAT gateway, so that one AZ's NAT gateway failing does not cut off the others. Interface endpoints and Resolver endpoints are created in multiple AZs.

The following diagram shows each tier repeated in three zones, sized to survive the loss of one.

A statically stable Multi-AZ design. Each Availability Zone has enough capacity to carry the load if another zone fails, its own NAT gateway with a per-zone route table, and a share of a Multi-AZ data tier. Losing a zone needs no scaling or reconfiguration before the remaining zones carry the traffic.
The percentages are illustrative: with three zones, each at 50% of peak, any two carry the full load.
Select all that apply

Single points of failure

Exam skills 2.2.2

Identify the single points of failure in an environment.

Log in to try this activity Interactive activities are free with an account.

Statelessness and decoupling

Instances should be stateless: sessions in ElastiCache or DynamoDB, files in S3 or EFS, configuration in Parameter Store, so that any instance can be replaced at any time. Tiers should be loosely coupled through SQS queues, SNS topics or EventBridge, so that a slow or failed consumer does not cause the producer to fail and work is retained until it can be processed. Retries with exponential backoff and jitter, timeouts and circuit breakers keep failures from cascading. The following table summarises common single points of failure and their fixes.

Single point of failureHighly available alternative
One EC2 instanceAuto Scaling group across AZs behind a load balancer
Single-AZ RDSRDS Multi-AZ or Aurora with replicas
One NAT gateway for all AZsNAT gateway per AZ or a regional NAT gateway
Sessions on local diskElastiCache or DynamoDB session store
EBS volume shared dataEFS or S3
Synchronous call to a slow serviceQueue-based decoupling with SQS

Elastic IP addresses

An Elastic IP address is a static public IPv4 address allocated to your account and associated with an instance or network interface. It can be remapped to another instance in seconds, which provides simple failover for designs that cannot use a load balancer, for example a legacy application that must be reached at a fixed address. A script or Lambda function triggered by a health alarm can call AssociateAddress to move the address to a standby instance. AWS charges for all public IPv4 addresses, including Elastic IPs that are not associated with a running instance, and the default quota is five per Region. For most workloads, a load balancer or Global Accelerator static IPs are better solutions.

Worked example

Surviving an AZ failure

An application runs four instances across two AZs, peaking at 70% CPU. If one AZ fails, the two remaining instances would need 140% CPU, so the application would degrade until Auto Scaling launched replacements, which may be slow during a large-scale event. The team moves to three AZs with six instances at 47% peak CPU; losing one AZ leaves four instances at about 70%, which they can carry. NAT gateways are added in the third AZ, and the RDS instance is converted to a Multi-AZ DB cluster for faster failover with readable standbys.

Check yourself

Why deploy one NAT gateway per Availability Zone?

Show answer

So that private subnets do not depend on one AZ; if it fails, the other AZs keep internet access.

Exam Tips

Remember for the exam

  • Run every tier in at least two AZs with enough capacity to lose one (static stability).
  • Use a NAT gateway per AZ (or a regional NAT gateway) to avoid a single-AZ dependency.
  • Keep instances stateless and decouple tiers with SQS.
  • Elastic IPs can be remapped for simple failover; all public IPv4 addresses are charged.