Where the cloud lives
The cloud is not in the sky. A cloud provider rents you computers that sit in data centres: big buildings full of servers, with their own power, cooling and network links. Where those buildings are matters.
A region is a separate geographic area where the provider has data centres. AWS gives each one a code: eu-west-1 is Ireland, us-east-1 is Northern Virginia. You choose the region when you create a server.
A region holds availability zones (AZs). Each zone is one or more data centres with its own power, cooling and network. AWS puts zones many kilometres apart, all within 100 km, joined by fast private links. Every AWS region has at least three.
Choose the region near your users: data takes time to travel, so near means faster replies. Also check the law (some data must stay in one country), the price and the services offered. Our users are in Europe, so eu-west-1.
Spread across zones
Now deploy the app. Instead of one server, run an identical copy in each zone: eu-west-1a, eu-west-1b, eu-west-1c. If one building has a problem, the other copies keep working. This is a multi-AZ deployment.
A load balancer sits in front. Every request from a user reaches it first, and it passes each one to a copy of the app, spreading the work. Users see one address. They never choose a zone.
When a zone fails
The load balancer also runs health checks: on a timer it asks each copy a simple question, such as fetching a test page. A copy that answers is marked healthy. Line 1 of the card keeps the same record.
Zone eu-west-1b loses power. Its copy stops answering, its health checks fail, and it is marked down. Line 2 records it: up["b"] = False. The other zones are separate buildings, so they keep running.
Now requests go only to the healthy copies, in zones a and c. Line 3 lists them and prints ['a', 'c']. Users notice nothing. But each remaining copy now carries more of the load, so plan spare room.
Beyond one region
Rarely, a problem hits a whole region. So keep a backup copy of your data in a second region far away, such as us-east-1. Being ready to recover there is called disaster recovery. Zones guard against a building failing; regions guard against an area failing.
What happens
;; step 1/10 · buildings cloud server = a real computer in a data centre (a building) with power, cooling, network you rent it; the provider runs the building so: where is the building?
Figures are AWS's: every AWS region has at least three availability zones, many kilometres apart and all within 100 km of each other. Google Cloud and Azure use the same two levels, regions and zones, with their own names and numbers. The figure is simplified: real load balancers also run nodes in every zone, and a real app usually stores its data in a database that is copied between zones too.