InfraCityOpen editor

X-region failover

When a whole region goes dark, DNS moves the users and the replica in the other region takes over.

X-region failover, drawn as an isometric city

The CityScript

This is all there is to it. Change it in the editor and the city redraws.

%% X · X-region failover
%% Two regions, one live and one warm. A health check flips DNS and promotes the replica; users barely notice.
city 48x32

district eu "EU region" 3,3..21,19
district us "US region" 27,3..45,19

building dns tower at 23,5 "Global DNS"
  floor dns.f "Traffic steering"
    room dns.geo config "Geo routing"
    room dns.health worker "Region health"
building eu-lb tower in eu "EU balancer"
  floor eu-lb.f "Entry"
    room eu-lb.lb proxy "Load balancer" port=443
building eu-app factory in eu "EU app"
  floor eu-app.f "App"
    room eu-app.api service "API" port=8080
building eu-db warehouse in eu "EU database, primary"
  floor eu-db.f "Postgres"
    room eu-db.pg database "Primary" port=5432
building us-lb tower in us "US balancer"
  floor us-lb.f "Entry"
    room us-lb.lb proxy "Load balancer" port=443
building us-app factory in us "US app"
  floor us-app.f "App"
    room us-app.api service "API" port=8080
building us-db warehouse in us "US database, replica"
  floor us-db.f "Postgres"
    room us-db.pg database "Replica" port=5432

pipeline failover "Region failover" dns -> [detect-outage] -> [promote-replica] -> [repoint-dns] -> us-lb
  step dns "The monitor sees that the main region is down"
  step us-lb "Customers are sent to the backup region"
link dns.geo -> eu-lb.lb "DNS: EU" variant=emphasis
link dns.geo -> us-lb.lb "DNS: standby" variant=dashed
link dns.health -> eu-lb.lb "health check" variant=dashed
link eu-lb.lb -> eu-app.api "HTTP" variant=emphasis
link eu-app.api -> eu-db.pg "SQL" variant=emphasis
link us-lb.lb -> us-app.api "HTTP"
link us-app.api -> us-db.pg "SQL"
link eu-db.pg -> us-db.pg "cross-region WAL" variant=dashed