Skip to content
Cloud architecture templates

Teaching Case — "Highly Available" in One Zone

Three application servers and a database, every one of them marked highly available, all of them inside a single availability zone. The count is the trap: `count 3` looks like redundancy and is not, because three instances in one zone is one zone. The engine says exactly that, in those words.

Template previewCloud architecture
Payments platform — availability reviewAn AWS architecture diagram: 5 resources in 7 scopes (1 network, 1 availability zone), joined by 4 connections. Categories drawn: Compute, Databases, Networking, Clients. No error and 3 warnings across 5 resources and 4 edges.Payments platform — availability reviewAWS · 5 resources · 7 scopes · 1 network · 1 zone · 4 connectionsNo error and 3 warnings across 5 resources and 4 edges.Internetintern…9AccountProducti…9Regionap-southeast…9NetworkVPC10.0.0.0/169+Availability zoneap-southeast-…1+SubnetApplicat…10.0.11.…private9+SubnetData10.0.21.0/24isolated9+Customers—4+Load balanceraws4+Payments APIaws×3HA1+LedgerawsHA2+Session cacheawsHA3+https 443http 8080postgres 5432redis 6379LegendComputeDatabasesNetworkingClientsRequest trafficChecks — what ran, and what could notWhether the internet reaches something that ho…ran over 5 subjects, found nothingWhether anything holding data at rest sits in …ran over 2 subjects, found nothingWhether anything claiming redundancy is spread…3 findings over 3 subjectsEdges that leave one network for another, or c…ran over 5 subjects, found nothingResources that appear in no edge at all. A leg…ran over 5 subjects, found nothingEvery id an edge or a scope names is one that …ran over 5 subjects, found nothingEach id is declared once. Two declarations mak…ran over 12 subjects, found nothingType words that did not resolve. A hole in thi…ran over 5 subjects, found nothingDeclared ranges: that each parses, sits inside…ran over 3 subjects, found nothingWhether every line was read and no shape cap b…ran over 12 subjects, found nothingFindings1`api` (EC2 instance) claims redundancy and everything it has sits in one zone, `ap-southeast-2a`. `count 3` does not help: 3 instances in one zone is one zone. Losingthat zone loses all of it.in the figure: api, ap-southeast-2a2`ledger` (RDS) claims redundancy and everything it has sits in one zone, `ap-southeast-2a`. Losing that zone loses all of it.in the figure: ledger, ap-southeast-2a (badge 1)3`sessions` (ElastiCache) claims redundancy and everything it has sits in one zone, `ap-southeast-2a`. Losing that zone loses all of it.in the figure: sessions, ap-southeast-2a (badge 1)4The walk reached 5 resources from the internet; every one of the 2 that hold data at rest — `ledger` and `sessions` — sits behind an ingress.in the figure: customers, lb, api (badge 1), ledger (badge 2), sessions (badge 3)5Every one of the 2 datastores this check could read — `ledger` and `sessions` — sits in a subnet declared private or isolated.in the figure: ledger (badge 2), sessions (badge 3)6Every edge this check could read stays inside one network, stays outside all of them, or names a gateway to cross at; 5 endpoints were read across 1 declared network.in the figure: customers (badge 4), lb (badge 4), api (badge 1), ledger (badge 2), sessions (badge 3)7All 5 declared resources appear in at least one edge.in the figure: customers (badge 4), lb (badge 4), api (badge 1), ledger (badge 2), sessions (badge 3)8All 5 ids named by edges and scopes were declared somewhere in this document.in the figure: customers (badge 4), lb (badge 4), api (badge 1), ledger (badge 2), sessions (badge 3)9All 12 declared ids are distinct.in the figure: internet, prod, ap-southeast-2, vpc, ap-southeast-2a (badge 1) +7 more10All 5 resources resolved to a type this engine knows, so every check above had the full vocabulary to read.in the figure: customers (badge 4), lb (badge 4), api (badge 1), ledger (badge 2), sessions (badge 3)11All 3 declared ranges parse, each of the 2 drawn inside an addressed network sits inside it, and no two ranges under one parent share an address. The 2 subnets thathave instances drawn in them hold them. Ranges under different parents were not compared — two networks numbered alike is ordinary and correct.in the figure: vpc (badge 9), app (badge 9), data (badge 9)12Every line was read and no shape cap bit: the 12 declarations above are the whole document, so the counts are totals rather than floors.

Make it your own.

title "Payments platform — availability review"
provider aws
note "Deliberately wrong. Everything claims redundancy from inside one zone."

internet {
  user customers "Customers"
}

cloud prod "Production" {
  region ap-southeast-2 {
    network vpc "VPC" cidr 10.0.0.0/16 {
      alb lb "Load balancer"

      zone ap-southeast-2a {
        subnet app "Application" private cidr 10.0.11.0/24 {
          ec2 api "Payments API" count 3 ha tier api
        }
        subnet data "Data" isolated cidr 10.0.21.0/24 {
          rds ledger "Ledger" multi-az
          elasticache sessions "Session cache" ha
        }
      }
    }
  }
}

customers -> lb : https 443
lb -> api : http 8080
api -> ledger : postgres 5432
api -> sessions : redis 6379