Cloud Computing
Regions, Zones, and Availability
Цели урока
- Understand the hierarchy of regions, AZs, and Edge Locations
- Select a region considering compliance, latency, and cost
- Design Multi-AZ deployments for 99.99% uptime
- Explain how CDN reduces latency from 150ms to 5ms
- Calculate theoretical minimum latency from distance
Предварительные знания
YouTube loads in milliseconds. The closest Google data center is 2,000 km away in Finland. How does YouTube cheat the speed of light? 600+ Edge servers, 35+ regions, and an architecture built to respect the laws of physics. Latency is the one problem in IT that no clever algorithm fixes.
- **Amazon** calculated: +100ms of latency = -1% conversion. At USD 500B annual revenue that's USD 5B in lost profit per year
- **Fortnite** (Epic Games) maintains servers in 20+ regions - ping above 80ms makes a shooter unplayable
- **GDPR** fines up to 4% of annual turnover for storing data in the wrong region - USD 746M fine for Amazon in 2021
How AWS Built Global Infrastructure
In 2006, Amazon Web Services launched with one region - us-east-1 in Virginia. By 2010 a second region appeared in Europe. By 2026, AWS operates in 30+ regions and 90+ Availability Zones worldwide. Each new region requires roughly USD 1B in investment. The decision to place a region is driven by three factors: proximity to customers, compliance requirements, and energy availability.
Regions: the geography of the cloud
A **Region** is a geographically distinct area where a cloud provider has stacked up a cluster of data centers. Each region stands alone: its own power, its own network, its own servers. A failure in one region does not bleed into the others. When us-east-1 had its 2021 incidents, eu-west-1 just kept humming - because the isolation is real, not marketing copy.
| AWS Region | Location | # of AZs | Notes |
|---|---|---|---|
| us-east-1 | Virginia, USA | 6 | Oldest and cheapest. Most new services launch here first |
| eu-west-1 | Ireland | 3 | Popular for GDPR-compliant European applications |
| eu-central-1 | Frankfurt | 3 | German data residency, financial sector |
| ap-northeast-1 | Tokyo | 4 | Largest in Asia, low latency for JP/KR |
| me-south-1 | Bahrain | 3 | Middle East, compliance for regional banks |
**Data residency** - the legal requirement to keep citizens' data inside a specific country. GDPR (Europe) keeps Europeans' personal data on EU soil. In 2021, Amazon was hit with a USD 746M fine for GDPR violations. Region selection is not just a latency call - it is a legal call.
| AWS Region | EC2 t3.medium (USD/hr) | S3 (USD/GB/mo) | Difference vs us-east-1 |
|---|---|---|---|
| us-east-1 (Virginia) | 0.0416 | 0.023 | base price |
| eu-west-1 (Ireland) | 0.0456 | 0.024 | +10% |
| ap-southeast-1 (Singapore) | 0.0520 | 0.025 | +25% |
| sa-east-1 (Sao Paulo) | 0.0680 | 0.031 | +63% |
| af-south-1 (Cape Town) | 0.0572 | 0.028 | +37% |
Prices swing hard. The same instance in Sao Paulo costs 63% more than in Virginia - electricity, taxes, infrastructure. When compliance lets the choice be open, pick the cheaper region.
Region selection playbook: 1. Compliance - where the law allows data to live 2. Latency - close to the users 3. Service availability - not every region carries every service 4. Price - the tiebreaker.
A fintech startup from Berlin processes data of European customers. Which region to choose for production?
Availability Zones: fault tolerance within a region
An **Availability Zone (AZ)** is one or more physical data centers inside a region. AZs are isolated: independent power, cooling, and network. They connect through a high-speed link with sub-1ms latency. In 2017, a 4-hour outage in us-east-1a took out a slice of AWS S3. Single-AZ sites went down. Multi-AZ services stayed up.
**Multi-AZ** - the load-bearing pattern for fault tolerance. Spread copies of the application across multiple AZs. If one AZ drops, traffic flips to the survivors automatically. The gap between 99.9% (8.7 hours of downtime per year) and 99.99% (52 minutes) is exactly Multi-AZ.
| Configuration | SLA Uptime | Downtime/year | Cost |
|---|---|---|---|
| Single AZ | 99.9% | 8.7 hours | Base |
| Multi-AZ (2 AZs) | 99.99% | 52 minutes | +~30-50% |
| Multi-AZ (3 AZs) | 99.999% | 5 minutes | +~50-80% |
| Multi-Region | 99.9999% | 31 seconds | +100-300% |
RDS Multi-AZ: AWS replicates the database to a second AZ on autopilot. Lose the primary AZ and failover lands in 60-120 seconds. Transparent to the application - the RDS DNS name does not budge.
Real incident (2017): a 4-hour outage in us-east-1a knocked out part of AWS S3. Single-AZ sites went dark. Multi-AZ services (Netflix, Airbnb) kept serving without missing a beat.
An application is deployed in a single AZ (eu-central-1a). The data center experiences a power failure. What happens?
Edge Locations and CDN
An **Edge Location** is a miniature data center planted as close to end users as possible. Single job: cache content so users do not have to wait on a distant origin. This is exactly how YouTube serves video in milliseconds when the actual servers sit thousands of kilometers away.
A **CDN (Content Delivery Network)** stitches Edge Locations into a global mesh. A user in Tokyo requests an image - the CDN delivers it from the nearest Edge in Tokyo, not from the origin in Virginia.
| CDN Provider | # of Edge PoPs | Highlights |
|---|---|---|
| CloudFront (AWS) | 600+ PoPs in 90+ cities | Deep AWS integration, Lambda@Edge for logic at the Edge |
| Cloudflare | 310+ PoPs in 120+ countries | DDoS protection, Workers for serverless at the Edge, free tier |
| Akamai | 4100+ PoPs | Largest CDN, serves 30% of global web traffic |
| Fastly | 90+ PoPs | Real-time cache invalidation in 150ms, VCL for custom logic |
Lambda@Edge / Cloudflare Workers run code right at the Edge Location. A/B tests, content personalization, redirects, authorization - all without a round trip to the origin. Latency: 1-5ms instead of 100-300ms.
Cache on the CDN: static assets (images, CSS, JS, fonts) and rarely-changing API responses (country lists, product catalogs). Do not cache: personal data, authorized requests, real-time data.
Cache invalidation is one of the two hardest problems in CS (Phil Karlton). Image updated on the origin but the CDN keeps serving the old one? Version the URL: `/img/logo-v2.png` or `?v=abc123` - far more reliable than waiting on TTL expiry.
A site with an audience in 50 countries stores images in S3 (us-east-1). Users in Asia complain about slow loading. The solution?
Latency: physics vs architecture
**Latency** - the time for data to travel client-to-server and back (Round-Trip Time, RTT). The hard floor is the speed of light: ~200,000 km/s in fiber (2/3 of vacuum speed). Amazon ran the numbers: every 100ms of latency = -1% conversion. On USD 500B in revenue, that is USD 5B walking out the door per year. No algorithm beats physics.
| Route | Distance | Theor. RTT | Real ping | UX impact |
|---|---|---|---|---|
| Local → Local (Edge) | ~10 km | <1ms | 1-5ms | Instant |
| London → Frankfurt | ~1,200 km | 12ms | 15-25ms | Imperceptible |
| New York → Frankfurt | ~6,200 km | 62ms | 80-110ms | Noticeable delay |
| New York → Sydney | ~16,000 km | 160ms | 250-350ms | Visibly slow |
| London → Sao Paulo | ~9,500 km | 95ms | 180-260ms | Poor UX |
Cumulative effect bites: a single page pulls 20 resources. If each is a separate request with 150ms RTT, the network alone burns 3 seconds. Amazon: +100ms of latency = -1% conversion. Google: +500ms load time = -20% traffic.
Multi-Region architecture is the only path to low latency for a global audience. Netflix, Spotify, Google all run infrastructure in 3+ regions. Route 53 (DNS) steers each user to the nearest one.
Latency reduction playbook: 1. CDN for static assets 2. Multi-Region for APIs 3. Database read replicas in each region 4. HTTP/2 multiplexing - many requests over one connection 5. Prefetching - pull data before the user even asks.
One region is enough for a global application - the internet is fast enough
The speed of light is a physical limit. For users on the other side of the planet, 200-400ms latency makes an application feel unresponsive. Global apps need multi-region
Amazon proved: +100ms latency = -1% in sales. At USD 500B annual revenue that's USD 5B in lost sales. Netflix, Google, Spotify - all use multi-region precisely for this reason. Physics can't be cheated - servers must be moved closer to users.
An application with servers in us-east-1 is getting complaints from users in Japan (ping 200ms). Which solution will have the greatest impact?
Key Takeaways
- Region - an independent cluster of data centers. Choice is determined by compliance, latency, and price
- Availability Zone - an isolated data center within a region. Multi-AZ = 99.99% uptime
- Edge Location - a content cache near the user. CDN reduces latency from 150ms to 5ms
- Latency is bounded by the speed of light - the only solution for global apps: multi-region
- YouTube loads instantly thanks to CDN, multi-region, and an architecture that respects physics
Related Topics
Regions and zones are the physical foundation of the cloud. Next we'll cover how to build networks and manage storage on top of this infrastructure:
- Virtualization and Containers — VMs and containers run inside AZs - previous lesson
- Introduction to Cloud Computing — IaaS/PaaS/SaaS models - the foundation of the course
Вопросы для размышления
- Where are the main users of the current project? Which region are the servers in? Is that configuration optimal?
- To ensure 99.99% uptime for a banking application - how many AZs and regions would be needed?
- What data in the project is subject to data residency requirements (GDPR) and how does that affect the region choice?
Связанные уроки
- cloud-01 — IaaS/PaaS/SaaS models are the course foundation
- cloud-02 — VMs and containers run inside AZs
- cloud-04 — VPC networks are built inside regions and AZs
- devops-03 — DNS load balancing and CDN are network mechanisms at global scale
- ds-02 — Multi-region is AP in CAP theorem: availability vs consistency
- sec-01 — Data residency and GDPR are compliance requirements for region selection
- net-50-cloud-networking