AWS Global Infrastructure
AWS runs data centres all over the world, organised in three levels. Understanding them is the key to building applications that stay up when something fails, and that are fast for users far away.
Regions
A Region is a geographic area, such as Northern Virginia (us-east-1), Ireland (eu-west-1) or Tokyo (ap-northeast-1). Each Region is fully independent: most resources you create (instances, databases, VPCs) live in exactly one Region, and data does not leave it unless you copy it.
How to choose a Region:
| Factor | Question |
|---|---|
| Compliance | Does the law require data to stay in a country? |
| Latency | Where are most of your users? |
| Service availability | Does the Region offer every service you need? (new services launch in some Regions first) |
| Price | Prices differ between Regions |
Availability Zones
Each Region contains several (usually three or more) Availability Zones (AZs), named like eu-west-1a, eu-west-1b. An AZ is one or more data centres with independent power, cooling and networking, located kilometres apart from the other AZs but connected to them with fast, low-latency links.
The point: a fire, flood or power failure should take out at most one AZ. If you run copies of your application in two or three AZs, it survives the loss of one. This is called a Multi-AZ design and appears in almost every lesson of this course.
Note: The letter suffix is mapped per account: your
eu-west-1amay be a different physical AZ than someone else'seu-west-1a. AZ IDs such aseuw1-az1are the same for everyone.
Edge locations and other sites
- Edge locations (points of presence) are many more, smaller sites in cities worldwide. CloudFront caches content there and Route 53 answers DNS queries from them, so users get responses from somewhere close.
- Local Zones put compute close to a big city for single-digit-millisecond latency.
- Wavelength Zones embed AWS compute in telecom 5G networks.
- Outposts put AWS racks in your own building.
Listing them with the CLI
aws ec2 describe-availability-zones --region eu-west-1 \
--query "AvailabilityZones[].[ZoneName,ZoneId,State]" --output tableSample output:
-----------------------------------------
| DescribeAvailabilityZones |
+-------------+------------+------------+
| eu-west-1a | euw1-az2 | available |
| eu-west-1b | euw1-az1 | available |
| eu-west-1c | euw1-az3 | available |
+-------------+------------+------------+Model: why more AZs mean higher availability
Suppose each AZ is available 99.5% of the time (an example figure) and failures are independent. Your application is down only when all the AZs it runs in are down at once:
az_availability = 0.995
minutes_per_year = 365 * 24 * 60
for azs in (1, 2, 3):
down_probability = (1 - az_availability) ** azs
availability = 1 - down_probability
downtime = down_probability * minutes_per_year
print(f"{azs} AZ(s): availability {availability:.6%}, expected downtime {downtime:8.2f} min/year")1 AZ(s): availability 99.500000%, expected downtime 2628.00 min/year
2 AZ(s): availability 99.997500%, expected downtime 13.14 min/year
3 AZ(s): availability 99.999988%, expected downtime 0.07 min/year
Going from one AZ to two cuts expected downtime from days to minutes. Real failures are not perfectly independent (a bad deployment hits all AZs at once), so this is an upper bound on the benefit, but the direction is right.
Model: choosing the closest Region
Latency grows with distance. This model picks, for each user city, the Region with the lowest example round-trip time:
rtt_ms = { # example round-trip times in milliseconds
"Paris": {"eu-west-3": 6, "us-east-1": 85, "ap-southeast-1": 160},
"New York": {"eu-west-3": 80, "us-east-1": 9, "ap-southeast-1": 230},
"Jakarta": {"eu-west-3": 170, "us-east-1": 240, "ap-southeast-1": 21},
"Sao Paulo": {"eu-west-3": 190, "us-east-1": 120, "ap-southeast-1": 330},
}
for city, options in rtt_ms.items():
best = min(options, key=options.get)
print(f"{city:<10} -> {best:<15} ({options[best]} ms)")
# One Region for everybody: minimise the worst user's latency
regions = ["eu-west-3", "us-east-1", "ap-southeast-1"]
worst = {r: max(city[r] for city in rtt_ms.values()) for r in regions}
print("worst-case latency per single Region:", worst)
print("best single Region:", min(worst, key=worst.get))Paris -> eu-west-3 (6 ms)
New York -> us-east-1 (9 ms)
Jakarta -> ap-southeast-1 (21 ms)
Sao Paulo -> us-east-1 (120 ms)
worst-case latency per single Region: {'eu-west-3': 190, 'us-east-1': 240, 'ap-southeast-1': 330}
best single Region: eu-west-3
São Paulo users would be better served by sa-east-1, which this table doesn't include: the right answer depends on the options you consider. For a global audience, real systems combine one or more Regions with CloudFront edge locations.
Test yourself
What is an Availability Zone?
- A country where AWS operates
- One or more isolated data centres inside a Region
- A CloudFront cache
- A billing unit
Why run an application in at least two AZs?
- It is required by AWS
- To survive the failure of one data centre site
- To get a lower price
- To use edge locations
Which of these is NOT usually a reason to pick a Region?
- Data residency laws
- Latency to users
- The Region's name length
- Which services are available