Cloud Computing Tutorial · Cloud Basics · Lesson 2 of 24
Regions and Availability Zones
How cloud infrastructure is organised into regions and availability zones, and how to use them for availability and latency.
Regions
A region is a geographic area (for example eu-west-1 in Ireland, us-east-1 in Virginia) containing
several data centres. Choose regions for:
- Latency: close to your users.
- Data residency and compliance: some data must stay in a country or the EU.
- Service availability and price: new services and instance types appear in some regions first, and prices differ between regions.
Availability zones
Each region has several availability zones (AZs): one or more data centres with independent power, cooling and networking, connected by fast low-latency links. Spreading an application across two or three AZs protects it from the failure of one data centre, which is the most common large failure.
| AWS | Azure | Google Cloud | |
|---|---|---|---|
| Region | Region | Region (some with availability zones) | Region |
| Isolated location in a region | Availability Zone | Availability zone | Zone |
| Paired disaster-recovery region | Your choice | Region pairs | Your choice |
def availability(single, copies):
return 1 - (1 - single) ** copies # works if at least one copy is up (independent failures)
single = 0.995 # one zone: about 44 hours of downtime a year
for zones in [1, 2, 3]:
a = availability(single, zones)
minutes = (1 - a) * 365 * 24 * 60
print(f"{zones} zone(s): {a:.6%} available, about {minutes:7.1f} minutes down per year")
Output
1 zone(s): 99.500000% available, about 2628.0 minutes down per year 2 zone(s): 99.997500% available, about 13.1 minutes down per year 3 zone(s): 99.999988% available, about 0.1 minutes down per year
Multi-AZ versus multi-region
Multi-AZ is the standard for production: cheap, low latency, and many managed services do it for you (RDS Multi-AZ, load balancers across zones). Multi-region protects against a whole-region failure but adds data replication, failover and cost; use it when the business needs it.
Test yourself
What protects an application from the failure of a single data centre at the lowest cost?
Running it across multiple availability zones in one regionBuying a bigger instanceUsing one zone with backups onlyMoving to another cloud
Show answer
Answer: Running it across multiple availability zones in one region
Zones fail independently and are close enough for synchronous replication and load balancing.