SkillSprout
Chapter 2 · Lesson 2
Beginner
7 min read

Availability Zones

Overview

An Availability Zone (AZ) is one or more discrete data centres inside a Region, each with its own redundant power, networking and cooling. AZs are physically separate — far enough apart that a fire, flood or power outage in one is unlikely to affect another, yet connected by fast private fibre so they behave like one logical data-centre cluster.

AZs are the main tool for high availability on AWS. If you place identical copies of your application in two or three AZs behind a load balancer, losing one AZ simply means the others carry on. Names look like us-east-1a, us-east-1b and so on.

The exam loves AZ questions: which resources are AZ-scoped, how to design Multi-AZ, what is charged for cross-AZ traffic and why subnets must be created in multiple AZs.

Key Concepts

  • Each Region has at least three AZs (some, like us-east-1, have six).
  • AZs have independent power, cooling and networking, and are connected by low-latency private fibre (single-digit milliseconds).
  • A subnet lives in exactly one AZ; a VPC spans all AZs in its Region.
  • EC2 instances, EBS volumes, NAT Gateways and subnets are AZ-scoped; EFS, S3, DynamoDB and SQS are Regional and automatically spread over AZs.
  • Multi-AZ designs give HA: RDS Multi-AZ, ALB across AZs, Auto Scaling across AZs, Aurora's six-copy storage.
  • AZ names (us-east-1a) are randomised per account; the AZ ID (use1-az1) is consistent.
  • Data transfer between AZs is charged (about $0.01/GB each way) while traffic within an AZ over private IPs is free.
  • S3 One Zone-IA and EBS volumes live in one AZ and are therefore less resilient.

Detailed Notes

Why AZs exist

AWS wants customers to build applications that continue running when part of the infrastructure fails. An AZ is a failure domain: a boundary within which things may fail together (power, cooling, network, a building). By placing components in different AZs you make failures independent.

text
Region: us-east-1
 +----------------+  +----------------+  +----------------+
 |  AZ  use1-az1  |  |  AZ  use1-az2  |  |  AZ  use1-az4  |
 |  DC  DC  DC    |  |  DC  DC        |  |  DC  DC        |
 +-------+--------+  +-------+--------+  +--------+-------+
         \______ redundant metro fibre _______/
  • AZs are typically tens of kilometres apart (within roughly 100 km), enabling synchronous replication with low latency.
  • Each AZ can contain one or many data centres.

AZ names vs. AZ IDs

AWS shuffles the mapping between the name (e.g. us-east-1a) and the physical zone per account to avoid everyone piling into "a". Two accounts' us-east-1a may be different buildings.

bash
aws ec2 describe-availability-zones --region us-east-1 \
  --query "AvailabilityZones[].[ZoneName,ZoneId]" --output table
# us-east-1a   use1-az6
# us-east-1b   use1-az1

Use the AZ ID when you must co-locate resources across accounts (e.g. with RAM-shared subnets or PrivateLink).

Which resources are tied to an AZ?

ScopeExamples
AZ-levelEC2 instances, EBS volumes, subnets, NAT Gateways, EFS mount targets, EC2 Dedicated Hosts, instance store
Regional (multi-AZ built in)S3, DynamoDB, SQS, SNS, Lambda, EFS, ALB/NLB (nodes per AZ), CloudWatch
Regional, you choose Multi-AZRDS Multi-AZ, ElastiCache replication groups, OpenSearch, MSK, Redshift (RA3 Multi-AZ)

Designing for multiple AZs

LayerHA technique
EntryALB/NLB with subnets in at least two AZs
ComputeAuto Scaling group across subnets in 2–3 AZs; ASG rebalances automatically
DatabaseRDS Multi-AZ (synchronous standby, automatic failover typically in 60–120 s); Aurora replicates 6 copies across 3 AZs and fails over in ~30 s
StorageEFS (multi-AZ by default) or S3; EBS snapshots to S3 for restoring in another AZ
NetworkOne NAT Gateway per AZ so an AZ failure doesn't cut egress

RDS Multi-AZ vs. read replicas

Multi-AZRead replica
PurposeHigh availability / failoverRead scaling
ReplicationSynchronousAsynchronous
Standby readable?No (classic Multi-AZ instance) — a Multi-AZ DB cluster has two readable standbysYes
ScopeSame Region, different AZSame or different Region

Moving an EBS volume to another AZ

An EBS volume cannot be attached across AZs. You snapshot it and restore in the target AZ:

bash
SNAP=$(aws ec2 create-snapshot --volume-id vol-0abc1234 --query SnapshotId --output text)
aws ec2 wait snapshot-completed --snapshot-ids $SNAP
aws ec2 create-volume --snapshot-id $SNAP --availability-zone us-east-1b

Auto Scaling across AZs in CloudFormation

yaml
WebAsg:
  Type: AWS::AutoScaling::AutoScalingGroup
  Properties:
    MinSize: "2"
    MaxSize: "6"
    VPCZoneIdentifier:           # one subnet per AZ
      - !Ref PrivateSubnetA
      - !Ref PrivateSubnetB
      - !Ref PrivateSubnetC
    TargetGroupARNs: [!Ref WebTargetGroup]
    HealthCheckType: ELB

Cost considerations

  • Cross-AZ traffic costs roughly $0.01/GB in each direction; chatty microservices or a single NAT Gateway serving other AZs can add up.
  • Highly available designs can double certain costs (extra NAT, standby DB) — justify them against the recovery objectives of the business.

Failure scenarios

FailureResult in a well-designed Multi-AZ system
Single EC2 instanceALB health check removes it; ASG replaces it
Whole AZ outageALB routes to remaining AZs; ASG launches replacements; RDS fails over
Whole Region outageNeeds Multi-Region (Route 53 failover, replicated data)

Real World Example

Scenario — an e-commerce checkout that must not go down.

An online marketplace processes orders 24/7. In its previous data centre a single power failure took checkout offline for three hours.

On AWS the team builds the checkout service in three AZs of one Region. An Application Load Balancer has a node in each AZ; an Auto Scaling group keeps at least two instances per AZ in private subnets; the order database is Aurora with a writer in AZ-a and readers in AZ-b and AZ-c; session state sits in a Multi-AZ ElastiCache for Redis replication group. Each AZ has its own NAT Gateway, so outbound payment-gateway calls survive an AZ failure.

During a real power event in one AZ, ALB health checks marked those instances unhealthy within seconds, traffic shifted to the other AZs, Aurora promoted a reader in about 30 seconds, and customers experienced a brief retry at most. Capacity was rebuilt automatically when the AZ recovered, with no engineers paged to fix servers.

Architecture Diagram

Multi-AZ web application
Architecture
AWS Cloud
Users
Region
Application Load Balancerspans AZ A + B
VPC
AZ A
Private subnet A
EC2 (ASG)
RDS primary
AZ B
Private subnet B
EC2 (ASG)
RDS standby

Every tier exists in more than one AZ, so a single AZ failure is survivable.

  1. 1Users connect to the ALB, which has nodes and targets in both AZs.
  2. 2Requests are balanced across healthy EC2 instances in AZ A and AZ B.
  3. 3The application writes to the RDS primary; data is synchronously replicated to the standby in the other AZ.
  4. 4If AZ A fails, ALB stops routing there, Auto Scaling adds capacity in AZ B and RDS fails over automatically.

Best Practices

  • ✓Run production in at least two AZs, preferably three, and verify each AZ can carry the load if another fails (N+1 capacity).
  • ✓Create one subnet per tier per AZ and attach Auto Scaling groups and load balancers to all of them.
  • ✓Use Multi-AZ for databases (RDS Multi-AZ, Aurora replicas, ElastiCache replication groups).
  • ✓Deploy one NAT Gateway per AZ and route each private subnet to its local NAT.
  • ✓Use AZ IDs when coordinating resources across accounts.
  • ✓Keep chatty traffic inside an AZ where possible and monitor cross-AZ transfer cost.
  • ✓Test failure with AWS Fault Injection Service or by simulating AZ loss (e.g. ARC zonal shift).
  • ✓Don't pin resources to a single AZ (hard-coded AZ names) — parameterise placement.

Common Interview Questions

Exam Tips

SAA-C03 focus

  • Multi-AZ = high availability inside a Region. If the question says "survive failure of a data centre/AZ", pick Multi-AZ.
  • Subnet = one AZ, VPC = whole Region. ASG/ALB must be pointed at subnets in multiple AZs.
  • EBS volumes and EC2 instances are AZ-bound; move EBS across AZs with a snapshot. EFS and S3 are not AZ-bound.
  • RDS Multi-AZ failover is automatic (DNS CNAME switches); read replicas are for read scaling and use async replication.
  • One NAT Gateway per AZ is the HA best practice — a single NAT is an AZ-level single point of failure.
  • S3 One Zone-IA stores data in a single AZ — cheaper, but data is lost if that AZ is destroyed.
  • Cross-AZ traffic is charged, traffic within an AZ using private IPs is free.

Finished this lesson?

0 of 64 lessons done · 0% of the course