Infrastructure Fundamentals

Regions and Availability Zones

A region is a geography and a jurisdiction; a zone is a failure domain. Confusing the two produces designs that look redundant on a diagram and share a single power feed in reality.

▶ Run the lab

The question this answers

Infrastructure question

What is a region, what is an availability zone, and which failures does each one actually contain?

Application requirement

The service must keep serving when a data centre loses power, must answer European users within a stated latency budget, and must keep customer records inside the EU because the contract says so.

What it provides

Two independent controls: placement in a geography with a legal jurisdiction and a distance to your users, and placement across isolated failure domains within that geography so that one facility's failure is survivable.

Application Requirement→Infrastructure Requirement→Compute→Network→Storage→Identity→Deployment→Scaling→Reliability→Observability→Security→Cost→Trade-offs

Two different words for two different problems

A region is a geographic area — a metro, roughly — with its own jurisdiction, its own price list, its own set of available services, and a physical distance to your users that sets a hard latency floor no engineering can remove. Regions are the unit of *data residency* and of *disaster*: a region-wide failure is rare and, when it happens, is the kind of event that makes the news.

An availability zone is one or more physically separate facilities inside a region, engineered to fail independently: separate power, separate cooling, separate network paths, far enough apart that one flood or fire does not take both, close enough that the round trip between them is small enough for synchronous replication. Zones are the unit of *ordinary failure*: a power event, a cooling failure, a network partition inside one building.

The design consequence is precise. Spreading across zones costs a little latency and no meaningful complexity, and it protects against the failures that actually happen. Spreading across regions costs a great deal — a distributed data problem, doubled operational surface, expensive continuous replication — and protects against a failure class that is genuinely rare. That asymmetry is why the honest default is *multi-zone always, multi-region only when a stated requirement forces it.* See Multi-Zone Deployment and Multi-Region Deployment.

One region, three zones. The database standby is in a different zone on purpose; the single NAT is the classic mistake.PROVIDER-NEUTRAL
Region eu-central— jurisdiction, price list, latency floor to users
Zone A— independent power, cooling and network
App instancesprivate
Database primaryprivate
NAT gateway (Zone A only)public
Zone B
App instancesprivate
Database standbyprivate— synchronous replication is affordable at intra-region latency
Zone C
Load balancer (regional)public— spans zones; the only public entry point
Object storage (regional)internal— already replicated across zones by the provider
Load balancer (regional)→App instances
Load balancer (regional)→App instances
App instances→Database primary
App instances→Database primary· cross-zone hop
Database primary→Database standby· synchronous replication
App instances→NAT gateway (Zone A only)· outbound — via Zone A

Distance is a physical constraint, and it shows up in the design

Latency between zones is small — a fraction of a millisecond to a couple of milliseconds — which is why synchronous replication between zones is a normal design and synchronous replication between continents is not. Latency between regions is bounded below by the speed of light in fibre, and no amount of provider engineering changes it: roughly 5 microseconds per kilometre of fibre, doubled for a round trip, plus routing that is never a straight line.

Concretely: a user in Frankfurt talking to a service in Frankfurt sees single-digit milliseconds. The same user talking to a service in Virginia sees something on the order of 90–100 ms of pure network round trip before the application does any work at all. If the page makes six sequential dependent requests, that is over half a second of nothing but distance. This is why "put a region near the users" is a real latency intervention and "add a bigger instance" is not.

It is also why chatty cross-region designs fail in a way that looks like an application bug. A service in region A calling a database in region B pays that round trip *per query*, and an ORM issuing fifty queries per request turns a 100 ms distance into a five-second page. The fix is architectural — fewer, larger round trips, or the data closer — never a faster instance. See CDN as Infrastructure for the read-path answer.

PATH                                    RTT (order of magnitude)   synchronous replication?
---------------------------------------  ------------------------   -----------------------
within one rack                          ~0.1 ms                    yes, trivially
zone A -> zone B, same region            ~0.5 - 2 ms                yes, this is the normal design
region -> region, same continent         ~10 - 30 ms                painful; usually asynchronous
Frankfurt -> Virginia                    ~90 - 100 ms               no. async, and accept an RPO
Frankfurt -> Sydney                      ~250 - 300 ms              no. treat as a separate system

WHAT THIS MEANS IN PRACTICE
  6 sequential dependent requests at 100 ms = 600 ms of pure distance
  an ORM issuing 50 queries across a region boundary = 5 s per page
  the fix is fewer round trips or closer data. never a bigger instance.

ILLUSTRATIVE: figures are rounded orders of magnitude for teaching. Measure your own paths.
Round-trip latency by distance. ILLUSTRATIVE — plausible orders of magnitude, not measurements.

Which failure does each level actually contain?

The value of the region/zone vocabulary is that it lets you state, for each component, which failures it survives. Doing that honestly usually reveals that a design labelled "highly available" survives an instance failure and nothing else, because every redundant copy sits in the same zone or depends on something that does.

The recurring instance of this is egress. A team spreads instances across three zones, feels redundant, and routes all outbound traffic through one NAT device in one zone. When that zone fails, the instances in the surviving zones are running, the load balancer reports them healthy, the internal health check passes — and every outbound call to a payment provider or an identity provider times out. The failure domain of the system was never the instance tier; it was the egress path, and nobody had drawn it.

The other recurring instance is the control plane. Provisioning new capacity, changing DNS, rotating a secret and reading logs all depend on provider APIs, and those APIs are themselves regional. A region incident frequently degrades the ability to *respond* to the region incident, which is why a failover plan that requires making changes in the failing region is not a plan. See Disaster Recovery.

FailureSingle instanceMulti-instance, one zoneMulti-zoneMulti-region
Process crash / OOMoutagesurvivessurvivessurvives
Instance or host failureoutagesurvivessurvivessurvives
Rack, power or cooling eventoutageoutagesurvivessurvives
Zone network partitionoutageoutagesurvives if egress and data are also multi-zonesurvives
Region-wide service degradationoutageoutageoutagesurvives with a tested failover and an accepted RPO
Bad deploy or bad configoutageoutageoutage — it replicates everywhereoutage — it replicates everywhere
Data deleted by mistakedata lossdata lossdata loss — replication copies the deletedata loss. only backups help — see Backup Strategy
What each redundancy level survives — and what it does not.

Key points

  • A region is a jurisdiction and a distance; a zone is a failure domain. They solve different problems and cost radically different amounts.
  • Multi-zone is the honest default: it survives the failures that actually occur, costs a cross-zone hop, and adds almost no design complexity.
  • Multi-region is a decision forced by a stated latency, residency or recovery requirement — never a default, and never automatically high availability.
  • Redundant compute with single-zone egress, DNS or data is not redundant; draw the failure domain of every dependency, not just the ones you scaled.
  • Replication propagates deletes and bad configuration. No amount of geographic spread substitutes for backups.

The loop, answered

Every field is required, which is why no lesson here can recommend something without saying what it costs and what simpler thing to consider first.

How it works
  • • The provider maps a zone identifier onto one or more physically separate facilities with independent power, cooling and network paths inside a metro area.
  • • Zones inside a region are joined by high-bandwidth, low-latency private links, which is what makes synchronous cross-zone replication and a single regional load balancer possible.
  • • Regional services (object storage, managed queues, most load balancers) are already spread across zones by the provider; zonal resources (an instance, a disk, a NAT device) are not, and you place them yourself.
  • • Cross-region connectivity runs over the provider backbone or the public internet, is metered per gigabyte, and is bounded below by the speed of light.
What you still own
  • • Placing every zonal resource deliberately, including the ones that are easy to forget: NAT devices, disks, cache nodes and the standby database.
  • • Verifying that a zone failure is actually survivable, by removing a zone on purpose rather than by reasoning about the diagram.
  • • Tracking which services in your design are regional and which are zonal; the list differs by provider and changes over time.
  • • Owning the residency claim: knowing where every copy of the data is, including backups, logs and the analytics pipeline nobody put on the diagram.
How it fails
  • • A zone fails and the surviving instances lose outbound connectivity because the single NAT device lived in the failed zone — internal health checks stay green throughout.
  • • A zone fails and capacity does not recover, because the remaining zones had no headroom and the scale-out competes with every other tenant doing the same thing at the same moment.
  • • A "multi-zone" database turns out to have its standby in the same zone as the primary, because the placement was left to a default.
  • • A region incident degrades the provider control plane, so the runbook step "provision replacement capacity" cannot be executed.
  • • Data residency is violated by a component nobody classified as data: logs, traces or a backup replicated to a cheaper region.
How it scales
  • • Capacity is per zone, and a zone can run out of a particular instance type independently — designs pinned to one instance family in one zone are the ones that fail to scale during an incident.
  • • Cross-zone traffic is usually metered, so a chatty service that lands randomly across three zones pays for a third to two-thirds of its internal traffic crossing a boundary.
  • • Adding a region multiplies the operational surface and does not add capacity for a single user, since a user is served by one region at a time.
Security
  • • Region choice is a compliance control: it decides jurisdiction, which decides who can compel access to the data.
  • • Zones are a reliability boundary, not a security boundary. Nothing about a zone limits what an identity can reach — that is Least Privilege in Infrastructure's job.
  • • Residency obligations extend to every derived copy: backups, snapshots, logs, traces, analytics exports and the disaster-recovery region.
  • • A second region doubles the surface where a secret, key or policy must be correct, and a rotation that misses one region fails silently until failover.
Cost shape
  • • Cross-zone traffic is usually metered per gigabyte in at least one direction — a real, recurring cost of doing multi-zone correctly.
  • • Zone redundancy multiplies the fixed cost of zonal components: three zones means three NAT devices, not one.
  • • Cross-region replication is continuous, bidirectional in active-active designs, and typically the most expensive transfer rate on the price list.
  • • Regions have different price lists for identical resources; a workload placed for latency may cost meaningfully more than the same workload elsewhere.
What to watch
  • • Per-zone health and per-zone request distribution — an even split is the evidence that zone redundancy is real rather than declared.
  • • Cross-zone and cross-region transfer volumes, which are simultaneously the cost signal and the "this service is chattier than we designed" signal.
  • • Replication lag on any standby, because lag is exactly the data you lose on failover — see RPO & RTO.
  • • The signal that lies: a regional aggregate health check. It stays green while one zone is completely dead, because two thirds of the fleet is answering.
Simpler alternatives
  • • A single zone with good backups, for internal tools and anything where a few hours of downtime is genuinely acceptable. Stating that acceptance is more honest than a half-built redundancy that has never been tested.
  • • Multi-zone within one region for essentially every production system — this is the alternative to multi-region, and it is the right one far more often than the industry discourse suggests.
  • • A CDN plus read replicas instead of a second region, when the requirement is read latency for distant users rather than survival of a region.
  • • Backup and restore into a second region (a cold recovery plan) instead of running one, when the RTO is measured in hours rather than minutes. Vastly cheaper and far easier to keep correct.
What adopting this costs
  • • Multi-zone buys survival of the common failures and charges cross-zone traffic plus duplicated zonal components. Almost always worth it.
  • • Multi-region buys survival of a rare failure class and charges a permanent distributed-data problem, doubled operations and the highest transfer rates on the price list.
  • • Choosing a region for latency may conflict with choosing it for cost, service availability or residency; these constraints frequently do not have a common solution and someone has to decide which loses.

Regions, zones and failure domains

Replicas, zones and failure domains
Place N replicas, then remove a zone or a region and read the surviving capacity. Redundancy only counts across a boundary the failure does not cross.
placement
Placement — the boxes are failure domains, not machinesILLUSTRATIVE
Region eu-west
Zone eu-aFAILED— 3 replicas
Replica 1FAILED
Replica 2FAILED
Replica 3FAILED
replicas
3
surviving
0
failure domains
1 zone / 1 region
peak served
no
surviving capacity vs peak need0 replicas · need 2
fails a zone lossdoes not survive a region losssingle-region write path
failure domain = the set of things that fail together
  same process   → a crash takes all of it
  same host      → a kernel panic takes all of it
  same zone      → one power or network event takes all of it
  same region    → a control-plane or provider event can take all of it
copies only count once they stop sharing the domain that failed
3 replicas in one zone is not 3 failure domains — it is one. The replicas protect you from a process crash and a bad host, and from nothing that happens to the building: shared power, shared top-of-rack network, shared cooling. This is the single most common redundancy mistake, and it looks completely healthy on a dashboard right up to the moment it does not.
failure
SIMULATEDcapacity is counted in replicas, not requests

What people believe, and what is true

Claim

Availability zones are just data centres in different cities.

Reality

They are close enough for low-millisecond round trips — same metro, usually — which is precisely what makes synchronous replication between them practical. Different cities would be different regions.

Claim

Multi-region means highly available.

Reality

It means you have a second copy of the infrastructure. Availability comes from a failover that has been tested, an agreed RPO, and a plan that does not require acting inside the failing region.

Claim

Replication across zones protects the data.

Reality

It protects against hardware loss. It faithfully replicates an accidental DELETE and a bad migration to every copy. Only backups with retention protect against that — see Backup Strategy.

Apply it

Check yourself

Answer out loud or on paper first, then compare. These come from the interview questions linked to this lesson.

  1. Leadership wants the system to be multi-region for high availability. What do you tell them?

    Show a strong answer

    Multi-region is a failure-domain and latency decision, and it is not automatically high availability. Two regions with a single primary database in one of them is one region of availability with a warm copy elsewhere; if failover has never been tested, it is one region of availability with a copy of the data and a plan.

    The first question is what problem is being solved. Regional outage survival, data residency, or user latency are three different requirements with three different answers, and only the first is an availability argument at all.

    The second question is whether the cheaper failure-domain work is done. Multi-zone within one region handles instance failure, rack failure, power and network events and most of what actually takes systems down — and it is a fraction of the cost and complexity, because zones share a low-latency network and a single data plane. Teams that jump to multi-region often still have a single-zone NAT gateway or a single-zone database that will take them down long before a region does.

    The third question is the data. Synchronous cross-region writes add tens of milliseconds to every commit; asynchronous replication means a failover loses whatever was in flight, so you must be able to say what your RPO is and reconcile afterwards. Active-active means accepting writes in two places, which means conflict resolution, which is a product decision about what happens when the same record is edited in both regions.

    And multi-region multiplies operational surface: two of everything to deploy, patch, monitor and pay for, cross-region data transfer charges, and a failover procedure that only works if it is rehearsed.

    Full interview question, with follow-ups and red flags →
  2. What are RPO and RTO, and how would you establish them for a payments system?

    Show a strong answer

    They are not definitions to recite, they are two numbers you have to get a business owner to say out loud. RPO: "if we lose the last N minutes of transactions, what happens?" For payments the honest answer is usually near zero for the ledger — a captured payment that vanishes is a customer charged with no record — and minutes are acceptable for analytics and reporting derived from it.

    RTO: "how long can checkout be down before the loss is unacceptable?" That is measured in revenue per minute, contractual credits, and whether customers retry or leave. Different components get different numbers: the payment path might be minutes, the admin dashboard hours, the monthly reporting job a day.

    Then map numbers to mechanisms, because each tier costs more. RPO of hours: nightly snapshots. RPO of minutes: snapshots plus continuous transaction-log shipping and point-in-time recovery. RPO near zero: synchronous replication to a second failure domain, paid for in write latency. RTO of hours: restore from backup on new infrastructure. RTO of minutes: a warm standby with automated promotion. RTO near zero: active-active with health-based traffic steering, and the consistency problems that come with it.

    And then verify the numbers rather than assume them. The measured RTO is a timed restore drill on a realistic dataset, not the number in the design document — restoring a 2 TB database takes as long as it takes, whatever the target says.

    Full interview question, with follow-ups and red flags →
  3. You are active-passive with async replication. What is your RPO, exactly?

    Show a strong answer

    Whatever the replication lag was at the moment of failure — measure it, alert on it, and know the distribution, not the average. Then answer the harder question: after failover, which writes were lost and how do you identify and replay them?

    Full interview question, with follow-ups and red flags →