InfraCityOpen editor

High availability

No single machine may take the service down: two of everything, in two zones, failing over by itself.

High availability, drawn as an isometric city

The CityScript

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

%% H · High availability
%% Two of everything in two zones. A floating IP moves to the standby balancer; the standby database is promoted.
city 48x32

district zone-a "Zone A" 3,3..22,18
district zone-b "Zone B" 26,3..45,18

building lb-a tower in zone-a "Balancer, active"
  floor lb-a.f "Balancer"
    room lb-a.ha proxy "HAProxy" port=80,443
    room lb-a.vip config "Floating IP"
building lb-b tower in zone-b "Balancer, standby"
  floor lb-b.f "Balancer"
    room lb-b.ha proxy "HAProxy" port=80,443
    room lb-b.vip config "Floating IP"
building app-a factory in zone-a "App A"
  floor app-a.f "App"
    room app-a.api service "API" port=8080
    room app-a.cache cache "Cache" port=6379
building app-b factory in zone-b "App B"
  floor app-b.f "App"
    room app-b.api service "API" port=8080
    room app-b.cache cache "Cache" port=6379
building db-a warehouse in zone-a "Database primary"
  floor db-a.f "Postgres"
    room db-a.pg database "Primary" port=5432
building db-b warehouse in zone-b "Database standby"
  floor db-b.f "Postgres"
    room db-b.pg database "Standby" port=5432

gate users at 0,8 port=443 "Public"
link lb-a.vip -> lb-b.vip "VRRP heartbeat" variant=dashed
link lb-a.ha -> app-a.api "HTTP" variant=emphasis
link lb-a.ha -> app-b.api "HTTP"
link app-a.api -> db-a.pg "SQL" variant=emphasis
link app-b.api -> db-a.pg "SQL"
link db-a.pg -> db-b.pg "streaming WAL" variant=dashed