Skip to main content
Cloud basicsLesson 3 of 17

When One Availability Zone Goes Down

The store's servers and DB are split across two availability zones within one region (an area where the provider groups its data centers). On the day one zone goes down entirely, follow what happens automatically and what is lost.

Servers taking requests2 / 2
Data lost (RPO)-
Downtime (RTO)-
Availability zone AAvailability zone BUserOrder requestLoad balancerSpreads to 2 zonesWeb server AZone AWeb server BZone BDB primaryRead · writeDB standbyReplica
RequestWatch

What you will learn

  • What an availability zone is and why to spread across two or more
  • How the primary DB replicates data to a standby
  • How a load balancer drops a dead server via health checks
  • Standby promotion, and what RPO and RTO mean
  • What changes if everything is in one zone

Failure-handling names (AWS · Azure · GCP)​

ConceptAWSAzureGCP
Availability zoneAvailability ZoneAvailability ZoneZone
Load balancer health checkTarget group health checkHealth probeHealth check
Primary/standby DB across zonesRDS Multi-AZ deploymentZone-redundant high availability (Flexible Server)Cloud SQL high availability (regional instance)

Try it yourself​

kubectl get nodes -L topology.kubernetes.io/zone # Zone of each node
kubectl get pods -o wide -n <namespace> # Which node each Pod runs on
kubectl get deploy <name> -o jsonpath='{.spec.template.spec.topologySpreadConstraints}' # Spread evenly across zones?
aws rds describe-db-instances --db-instance-identifier <db> --query 'DBInstances[].[MultiAZ,AvailabilityZone,SecondaryAvailabilityZone]' # Primary and standby zones (AWS example)
aws elbv2 describe-target-health --target-group-arn <tg-arn> # Health check result per target

Check yourself

  1. Zone A loses power. Why do some requests still fail for a short time even with a healthy server in zone B?
  2. After the standby DB is promoted, what must the app handle to keep working?
  3. The DB uses synchronous replication to its standby. What is the RPO for a zone outage?

Further reading: Running in multiple zones (Kubernetes docs) · Pod Topology Spread Constraints · Regions and Availability Zones (AWS)