A bakery chain in many cities
Picture a bakery chain. It doesn't bake in just one place: it has branches in many cities, far apart, such as Dublin and Tokyo. You choose which city bakes your bread.
Inside each city there are several separate bakeries, at least three. They sit in different parts of town, far enough apart that one flood or fire can't reach two of them, but close enough that a van gets between them in minutes. Each bakery has its own power line, its own water and its own ovens, so a power cut at one doesn't touch the others.
The chain calls each of those separate bakeries an Availability Zone. Press play to see the map.
Regions and Availability Zones
AWS infrastructure is split into Regions: separate geographic areas such as eu-west-1 (Ireland) or
ap-northeast-1 (Tokyo). Regions are isolated from each other, and most services run independently in each one.
When you create a resource, you choose its Region.
Each Region contains at least three Availability Zones (AZs) (an account may see fewer: newer accounts get two in us-west-1). An AZ is one or more discrete data centres with
redundant power, networking and connectivity of its own. Generators and cooling aren't shared between AZs.
| Term | Meaning |
|---|---|
| Region | A geographic area, e.g. eu-west-1, isolated from other Regions |
| Availability Zone | One or more data centres in a Region, e.g. eu-west-1a, isolated from the other AZs |
| AZ ID | A zone's fixed identifier, e.g. use1-az1, the same in every account |
AZs in a Region are up to about 100 km (60 miles) apart: far enough to avoid correlated failures such as floods or power outages, close enough for synchronous replication. They're joined by redundant, high-bandwidth, low-latency fibre, with single-digit millisecond round trips. Traffic between AZs is billed per GB in each direction; traffic within one AZ on private addresses usually isn't.
Regions launched after 20 March 2019 are opt-in: they're disabled in an account until you enable them.
Baking in two bakeries at once
If all your bread comes from one bakery, a power cut there means no bread. So you bake in two bakeries in the same city. The order desk sends each order to whichever bakery is working.
The order book matters most. The main bakery keeps it, and a standby bakery copies every new line straight away, before the order counts as done. If the main bakery goes dark, the standby already has every line and takes over. That's called running Multi-AZ.
Multi-AZ for high availability
An AZ is a failure domain: it can lose power or network on its own. A workload in one AZ goes down with it, so production systems spread across at least two, usually three:
- Compute: an Auto Scaling group across subnets in several AZs, behind a load balancer (ALB or NLB) with nodes in each of them. Health checks stop routing to targets in a failed AZ.
- Databases: RDS Multi-AZ keeps a synchronous standby in another AZ. A write is acknowledged only after the standby has it, so failover loses no committed data. On failure, RDS flips the endpoint's DNS name to the standby; this typically takes 60 to 120 seconds, and clients must reconnect.
- Managed services such as S3 (except its One Zone storage classes), DynamoDB and SQS store data across several AZs for you.
Plan capacity so the remaining AZs can carry the load: with two AZs, each must handle 100% on its own. Synchronous replication works here only because AZs are close; it adds a little write latency, and cross-AZ traffic costs money.
Opening in another city
Some reasons to bake in a second city:
- Fresh bread for faraway customers. Bread from Dublin takes ages to reach Tokyo. A Tokyo branch bakes it close by.
- A whole city in trouble. A big storm could close every bakery in one city. A branch in another city keeps going.
- Rules about order details. Some places say their customers' order details must never leave the country. So you keep European order details in European cities only.
Copying the order book to another city takes a while, so the far copy is always a little behind. If the first city closes suddenly, the last few lines may be missing.
Multiple Regions
Multi-AZ survives a data-centre failure, not a Regional one. Reasons to go multi-Region:
- Latency: a round trip from Tokyo to Ireland takes far longer than one within Japan. Serve users from a nearby Region, steered by Route 53 latency or geolocation routing, or cache at the edge with CloudFront.
- Disaster recovery: survive a Regional outage. Strategies range from backup and restore, to pilot light, to warm standby, to active-active, trading cost against recovery time (RTO) and data loss (RPO).
- Data residency: AWS doesn't move your content out of the Region you chose without your agreement (except as needed to run a service you asked for or to comply with law), so keeping EU personal data in EU Regions helps meet rules such as GDPR.
Replication between Regions (S3 Cross-Region Replication, DynamoDB global tables in their default mode, Aurora Global Database, RDS cross-Region read replicas) is usually asynchronous: distances are too large to wait on every write. (DynamoDB's multi-Region strong consistency mode does wait, and pays for it in write latency.) The replica lags, so a sudden failover can lose the last writes, and active-active writes need conflict handling. Not every service or instance type exists in every Region, and data transfer between Regions is billed.
In Java, each AWS SDK client is bound to one Region when it's built, so multi-Region code builds one client per Region:
1S3Client ireland = S3Client.builder().region(Region.EU_WEST_1).build();2S3Client frankfurt = S3Client.builder().region(Region.EU_CENTRAL_1).build();34// No region in code: the default chain checks the aws.region system property,5// then AWS_REGION, then the shared config file, then EC2 instance metadata.6S3Client fromEnvironment = S3Client.create();
With Spring Cloud AWS, set it once in configuration: spring.cloud.aws.region.static=eu-west-1.
Chain-wide, city-wide and one-bakery things
Some things belong to the whole chain. The staff badge list works in every city: a badge made once opens doors in Dublin and Tokyo. The chain's phone book tells callers which city to ring.
Some things belong to one city. The city's pantry is shared by all its bakeries, and its sacks are spread across them, so losing one bakery loses no flour. But Dublin's pantry is not in Tokyo.
And some things live in one bakery. An oven stands in one building, and its tray cupboard stands right beside it. If that bakery goes dark, its ovens and cupboards go dark with it. These are called zonal things.
Global, Regional and zonal services
Every AWS resource has a scope, and the scope decides what a failure takes down:
| Scope | Examples | Fails with |
|---|---|---|
| Global | IAM users and roles, Route 53 hosted zones, CloudFront distributions | Rarely; data planes are spread worldwide |
| Regional | S3 general purpose buckets, DynamoDB tables, Lambda functions, SQS queues, VPCs | Its Region |
| Zonal | EC2 instances, EBS volumes, subnets | Its AZ |
Regional services replicate across AZs for you. Zonal resources don't: an EBS volume attaches only to instances in its own AZ, and to move one you snapshot it and restore in another AZ. That's why you run several instances across AZs rather than one big one.
S3 is Regional even though bucket names are globally unique: a bucket's data lives in the Region you pick. "Global"
services still have a home: the control planes for IAM, Route 53 and CloudFront run in us-east-1. Their data planes
(signing in with a role, answering DNS queries) keep working elsewhere if it has trouble, but creating or changing
them may fail, so don't make a recovery plan depend on those changes.
Whose bakery A?
Every customer gets a map of the city with its bakeries marked A, B and C. But in a few of the oldest cities, the chain shuffled the letters for older customers. Ana's bakery A might be Ben's bakery C. That way not everyone piles into bakery A.
So when Ana and Ben want to bake side by side, "let's both use A" can send them to different buildings. Each bakery also has a fixed street address that is the same on every map, called its AZ ID. Ana and Ben agree on the street address instead.
AZ names and AZ IDs
An AZ name such as us-east-1a is a per-account label. In six of the oldest Regions (us-east-1, us-west-1,
us-west-2, ap-southeast-1, ap-southeast-2, ap-northeast-1), AWS mapped names to physical zones independently
for each account, to spread load evenly, so us-east-1a in one account can be a
different data centre from us-east-1a in another. AWS documents that accounts created from November 2025 get the
same mapping in those Regions; older accounts keep theirs. Other Regions already map names uniformly.
The AZ ID (use1-az1, euw1-az2) names the physical zone and is the same in every account. Use AZ IDs whenever
zones must line up across accounts: sharing subnets with AWS RAM, placing a client next to a service in another
account to avoid cross-AZ latency and cost, or reading capacity reports. Look up your mapping with
aws ec2 describe-availability-zones, which returns both ZoneName and ZoneId.