Course outline · 0% complete

0/27 lessons0%

Course overview →

Regions and availability zones

lesson 1-2 · ~10 min · 2/27

Where your server actually lives

AWS does not have one giant data center. It has clusters of them all over the world.

  • A region is a city-sized cluster, named after its location: us-east-1 (Virginia), eu-central-1 (Frankfurt), ap-northeast-1 (Tokyo). There are over 30.
  • An availability zone (AZ) is one or more data centers inside a region, with independent power, cooling, and network. A region has at least 3, named us-east-1a, us-east-1b, and so on.

Why the split? A flood or power cut can take out one building. AZs are far enough apart that one disaster rarely touches two, but close enough that computers in different AZs talk in about a millisecond. Running your app in two AZs is the standard first step toward surviving a bad day.

Region us-east-1AZ us-east-1aAZ us-east-1bAZ us-east-1cRegion eu-central-1AZ aAZ bAZ cRegion ap-northeast-1AZ aAZ bAZ cEach region is independent. Each AZ inside it has its own power and cooling.
Three of AWS's 30+ regions. The gold dot is your app: you choose exactly one region for it, and inside that region you can spread it across AZs.

Choosing a region

Three things decide it:

  1. Latency. Light in fiber takes real time. A user in Berlin talking to Virginia adds roughly 90 ms to every request, so you deploy near your users.
  2. Law. Some data legally has to stay in a country (health records in Germany, for example). You pick the region inside that border.
  3. Price and features. New services and lower prices tend to reach us-east-1 first.

Data does not move between regions unless you move it. If you launch a server in eu-central-1, that is the only place it exists.

Computing the latency floor between two cities

The latency rule is physics you can compute. Light in fiber covers about 200 km per millisecond, and a request has to travel there and back.

distance_km=6700
speed_km_per_ms=200   # light in fiber, roughly
rtt_ms=$((2 * distance_km / speed_km_per_ms))
echo "Berlin -> Virginia round trip: $rtt_ms ms"
distance_km=10900
rtt_ms=$((2 * distance_km / speed_km_per_ms))
echo "Tokyo -> Virginia round trip: $rtt_ms ms"

Output

Berlin -> Virginia round trip: 67 ms
Tokyo -> Virginia round trip: 109 ms

Reading the arithmetic

  • The Tokyo lines reuse the same formula with distance_km reassigned to 10900. In bash, numbers are compared and computed inside $(( )).
  • Tokyo to Virginia works out to 2 × 10900 / 200 = 109 ms, and that is the floor before AWS has started any work on the request. Add the actual processing and a page can feel sluggish for no reason a profiler will ever show you.
  • That floor is exactly why AWS builds a region in ap-northeast-1 near Tokyo instead of running one giant data center. No amount of faster hardware can beat the speed of light in glass.

What an availability zone is

An availability zone is best described as one or more data centers inside a region, with independent power and network.

The two words are easy to mix up, so it is worth fixing the pair side by side. A region is the city-sized cluster you pick, such as us-east-1. An AZ is an isolated data-center group inside it, such as us-east-1a.

AZs exist for one reason: so that one building failure does not take down an app that runs in two of them. A flood, a power cut, or a cooling failure hits a building, not a city, and independent power and network mean the neighbouring AZ keeps serving.

Choosing a region for a German hospital app

The right region is eu-central-1, which is AWS's Frankfurt region.

It satisfies both constraints at once. The law requires patient data to sit on servers physically in Germany, and Frankfurt is in Germany. The latency rule wants servers near the users, and the users are all in Germany too. When law and latency point the same way the choice is easy, and it usually happens for apps serving one country.

Two details make the answer findable. Region names follow the pattern area-position-number, so a European region starts with eu-. And the Frankfurt region was named in the first section of this lesson.