InfraCityOpen editor

Everything, A to Z

All 26 parts in five levels, from the outside in, joined by streets, avenues and flows: a request, an order's events, a release, the network, off-site copies.

This is a big city. Its link, once you change it, is too long for chat apps such as Slack. Share a link to this page to show it as it is. To share your own version, keep it as a saved design (Pro) for a short link, or send the city as a file.

Everything, A to Z, drawn as an isometric city

The CityScript

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

%% Everything, A to Z: all 26 parts of an infrastructure in one city, joined by the flows between them.
%% Five levels, from the top, each an area of its own with a name:
%%   1 · The way in: C E W L A H
%%   2 · Network and access: X V F I N
%%   3 · Safe and watched: U T M B S
%%   4 · Messages and data: O J K D Q
%%   5 · Delivery: P R G Z Y
%% Each block is named with its part's letter; the parts are the examples of the same letters.
%% Flows and links follow the streets and the avenues between the levels.
%% Add host=, project= and service= to bind it to real hosts.
city 119x124 theme=architect packs=core

district a.front "A · Front door" 79,4..92,10
district a.services "A · Services" 79,11..92,17
district b.prod "B · Production" 75,55..86,60
district b.vault "B · Off-site vault" 75,61..86,65
district b.drill "B · Restore drill" 87,55..92,65
district c.world "C · Edge locations" 4,4..14,11
district c.origin "C · Origin" 4,12..14,17
district d.clients "D · Application" 62,79..76,84
district d.data "D · Database tier" 62,85..76,92
district e.internet "E · The internet" 17,4..28,10
district e.edge "E · Edge" 17,11..28,17
district e.cluster "E · Cluster" 29,4..38,17
district f.dmz "F · DMZ" 54,31..63,41
district f.app "F · App zone" 64,31..69,41
district f.data "F · Data zone" 70,31..77,36
district g.source "G · Source of truth" 50,106..54,113
district g.cluster "G · Cluster" 55,106..67,113
district h.zone-a "H · Zone A" 95,4..108,10
district h.zone-b "H · Zone B" 95,11..108,17
district i.idp "I · Identity provider" 80,31..93,36
district i.tools "I · Internal tools" 80,37..93,41
district j.cron "J · Scheduler" 21,79..35,85
district j.pool "J · Worker pool" 21,86..35,92
district k.producers "K · Producers" 38,79..49,84
district k.cluster "K · Kafka cluster" 38,85..49,92
district k.consumers "K · Consumers" 50,79..59,92
district l.front "L · Balancers" 63,4..76,10
district l.pool "L · Web pool" 63,11..76,17
district m.watched "M · Things being watched" 52,55..62,65
district m.watch "M · Observability" 63,55..72,65
district n.public "N · Public subnet" 96,31..107,35
district n.private "N · Private subnet" 96,36..107,41
district n.isolated "N · Isolated subnet" 108,31..114,41
district o.clients "O · Clients" 4,79..18,84
district o.store "O · Object store" 4,85..18,92
district p.staging "P · Staging" 4,106..9,113
district p.prod "P · Production" 10,106..15,113
district q.producers "Q · Producers" 79,79..88,86
district q.broker "Q · RabbitMQ" 79,87..88,92
district q.consumers "Q · Consumers" 89,79..98,92
district r.supply "R · Software supply chain" 32,106..41,113
district r.runtime "R · Where images run" 42,106..47,113
district s.vault "S · Vault cluster" 95,55..107,59
district s.apps "S · Applications" 95,60..107,65
district t.hosts "T · Hosts" 28,55..38,65
district t.telemetry "T · Telemetry" 39,55..49,65
district u.probes "U · Probe locations" 4,55..17,59
district u.service "U · The service" 4,60..17,65
district u.comms "U · Communication" 18,55..25,65
district v.outside "V · Outside" 34,31..45,36
district v.access "V · Access layer" 34,37..45,41
district v.inside "V · Private network" 46,31..51,41
district w.edge "W · Filter" 41,4..50,10
district w.web "W · Web tier" 41,11..50,17
district w.app "W · App tier" 51,4..60,17
district x.eu "X · EU region" 4,31..17,41
district x.us "X · US region" 18,31..31,36
district y.code "Y · Code" 92,106..101,113
district y.cloud "Y · Cloud account" 102,106..115,113
district z.stacks "Z · Two versions side by side" 70,106..79,113

building a.gateway tower at 84,5 "API gateway"
  floor a.gw.edge "Edge"
    room a.gw.proxy proxy "Kong" port=8000
    room a.gw.limits cache "Rate limits" port=6379
    room a.gw.auth service "Token check" port=9001 secret=jwt-signing-key
building a.orders factory at 80,12 "Orders"
  floor a.orders.app "Orders"
    room a.orders.api service "Orders API" port=8080
    room a.orders.db database "Orders DB" port=5432
building a.catalog factory at 84,12 "Catalog"
  floor a.catalog.app "Catalog"
    room a.catalog.api service "Catalog API" port=8080
    room a.catalog.index storage "Search index" port=9200
building a.payments factory at 88,12 "Payments"
  floor a.payments.app "Payments"
    room a.payments.api service "Payments API" port=8080
    room a.payments.db database "Payments DB" port=5432
building b.db tower at 79,56 "Primary DB"
  floor b.db.data "Data"
    room b.db.pg database "Postgres" port=5432
    room b.db.wal worker "WAL-G agent"
building b.bucket warehouse at 76,62 "Backup bucket"
  floor b.bucket.daily "Backups"
    room b.bucket.snap storage "Snapshots, 30 days"
      cost 12 "Backup storage" vendor=Backblaze plan=B2 spec="2 TB, 30 days of snapshots"
    room b.bucket.wal storage "WAL archive"
      cost 3 "WAL archive" vendor=Backblaze plan=B2
  floor b.bucket.lock "Retention"
    room b.bucket.immutable config "Object lock"
building b.copy warehouse at 81,62 "Second region"
  floor b.copy.f "Copy"
    room b.copy.bucket storage "Cross-region copy"
      cost 12 "Second copy" vendor=Backblaze plan=B2 spec="2 TB, another region"
building b.restore factory at 88,56 "Restore test"
  floor b.restore.f "Rehearsal"
    room b.restore.pg database "Scratch Postgres" port=5432
    room b.restore.check worker "Integrity check"
building c.pop-bru depot at 5,5 "Brussels"
  floor c.pop-bru.f "Cache"
    room c.pop-bru.cache cache "Edge cache"
    room c.pop-bru.tls proxy "TLS" port=443 secret=tls-private-key
building c.pop-ams depot at 9,5 "Amsterdam"
  floor c.pop-ams.f "Cache"
    room c.pop-ams.cache cache "Edge cache"
    room c.pop-ams.tls proxy "TLS" port=443 secret=tls-private-key
building c.pop-par depot at 5,8 "Paris"
  floor c.pop-par.f "Cache"
    room c.pop-par.cache cache "Edge cache"
    room c.pop-par.tls proxy "TLS" port=443 secret=tls-private-key
building c.pop-fra depot at 9,8 "Frankfurt"
  floor c.pop-fra.f "Cache"
    room c.pop-fra.cache cache "Edge cache"
    room c.pop-fra.tls proxy "TLS" port=443 secret=tls-private-key
building c.shield warehouse at 5,14 "Origin shield"
  floor c.shield.f "Shield"
    room c.shield.cache cache "Shield cache"
      cost 25 "CDN" vendor=Cloudflare plan=Pro
building c.web factory at 10,13 "Web origin"
  floor c.web.f "Origin"
    room c.web.nginx proxy "nginx" port=80,443
      cost 17 "Virtual server" vendor=Hetzner plan=CPX31 spec="4 vCPU, 8 GB RAM, 160 GB SSD"
    room c.web.app service "App" port=3000
    room c.web.assets storage "Static assets"
building d.app factory at 67,80 "App servers"
  floor d.app.f "App"
    room d.app.rw service "Writes" port=8080
    room d.app.ro service "Reads" port=8080
building d.pool tower at 65,86 "Connection pooler"
  floor d.pool.f "Pooling"
    room d.pool.bouncer proxy "PgBouncer" port=6432
building d.primary warehouse at 68,86 "Primary"
  floor d.primary.f "Postgres"
    room d.primary.pg database "Primary" port=5432
    room d.primary.wal queue "WAL stream"
building d.replica-a warehouse at 63,89 "Replica A"
  floor d.replica-a.f "Postgres"
    room d.replica-a.pg database "Replica, sync" port=5432
building d.replica-b warehouse at 68,89 "Replica B"
  floor d.replica-b.f "Postgres"
    room d.replica-b.pg database "Replica, async" port=5432
building d.patroni tower at 73,89 "Failover manager"
  floor d.patroni.f "Patroni"
    room d.patroni.agent config "Patroni"
    room d.patroni.etcd config "etcd" port=2379
building e.dns tower at 18,12 "DNS & TLS"
  floor e.dns.f "Names"
    room e.dns.zone config "DNS zone" port=53
    room e.dns.certs config "Certificates" secret=tls-private-key
building e.shield tower at 21,12 "DDoS shield & WAF"
  floor e.shield.f "Shield"
    room e.shield.ddos proxy "DDoS scrubbing" port=443
    room e.shield.waf proxy "WAF rules" port=443
building e.lb depot at 24,12 "Load balancer"
  floor e.lb.f "Balancer"
    room e.lb.l4 proxy "L4 balancer" port=443
    room e.lb.health worker "Health checks"
building e.ingress factory at 30,5 "Ingress controller"
  floor e.ingress.f "Ingress"
    room e.ingress.nginx proxy "nginx ingress" port=80,443
    room e.ingress.cert worker "cert-manager" secret=acme-account-key
building e.apps factory at 34,5 "Apps"
  floor e.apps.f "Services"
    room e.apps.web service "Web" port=3000
    room e.apps.api service "API" port=8080
building f.fw-edge tower at 71,38 "DMZ firewall"
  floor f.fw-edge.f "Rules"
    room f.fw-edge.in config "Allow 443 in"
    room f.fw-edge.deny config "Deny the rest"
building f.fw-core tower at 74,38 "Core firewall"
  floor f.fw-core.f "Rules"
    room f.fw-core.db config "Allow 5432 from apps"
    room f.fw-core.deny config "Deny the rest"
building f.proxy factory at 55,32 "Reverse proxy"
  floor f.proxy.f "Proxy"
    room f.proxy.nginx proxy "nginx" port=80,443
    room f.proxy.waf proxy "WAF" port=443
building f.bastion depot at 59,33 "Bastion"
  floor f.bastion.f "Admin access"
    room f.bastion.ssh proxy "SSH jump host" port=22 secret=host-key
    room f.bastion.audit storage "Session recordings"
building f.web factory at 65,32 "App servers"
  floor f.web.f "Apps"
    room f.web.app service "App" port=3000
    room f.web.cache cache "Session cache" port=6379
building f.db factory at 72,32 "Databases"
  floor f.db.f "Data"
    room f.db.pg database "Postgres" port=5432
    room f.db.backup worker "Backups"
building g.repo tower at 51,107 "Config repo"
  floor g.repo.f "Git"
    room g.repo.main storage "main branch"
    room g.repo.pr config "Pull requests"
building g.argo tower at 56,108 "Argo CD"
  floor g.argo.f "Controller"
    room g.argo.sync worker "Sync loop"
    room g.argo.diff worker "Drift detector"
building g.shop factory at 59,107 "shop namespace"
  floor g.shop.f "Workloads"
    room g.shop.web service "web" port=3000
    room g.shop.api service "api" port=8080
    room g.shop.db database "postgres" port=5432
building g.platform factory at 63,107 "platform namespace"
  floor g.platform.f "Workloads"
    room g.platform.ingress proxy "ingress" port=443
    room g.platform.mon service "monitoring" port=9090
building h.lb-a tower at 96,6 "Balancer, active"
  floor h.lb-a.f "Balancer"
    room h.lb-a.ha proxy "HAProxy" port=80,443
    room h.lb-a.vip config "Floating IP"
building h.lb-b tower at 96,13 "Balancer, standby"
  floor h.lb-b.f "Balancer"
    room h.lb-b.ha proxy "HAProxy" port=80,443
    room h.lb-b.vip config "Floating IP"
building h.app-a factory at 99,5 "App A"
  floor h.app-a.f "App"
    room h.app-a.api service "API" port=8080
    room h.app-a.cache cache "Cache" port=6379
building h.app-b factory at 99,12 "App B"
  floor h.app-b.f "App"
    room h.app-b.api service "API" port=8080
    room h.app-b.cache cache "Cache" port=6379
building h.db-a warehouse at 103,6 "Database primary"
  floor h.db-a.f "Postgres"
    room h.db-a.pg database "Primary" port=5432
building h.db-b warehouse at 103,13 "Database standby"
  floor h.db-b.f "Postgres"
    room h.db-b.pg database "Standby" port=5432
building i.keycloak factory at 83,32 "Keycloak"
  floor i.kc.f "Identity"
    room i.kc.oidc service "OIDC and SAML" port=8443 secret=signing-key
    room i.kc.mfa service "MFA"
    room i.kc.db database "Sessions" port=5432
building i.directory tower at 87,33 "Directory"
  floor i.dir.f "People"
    room i.dir.ldap database "LDAP" port=389
    room i.dir.groups config "Groups and roles"
building i.grafana depot at 81,38 "Grafana"
  floor i.grafana.f "Login"
    room i.grafana.sso proxy "SSO login" port=443 secret=client-secret
building i.git depot at 85,38 "Git server"
  floor i.git.f "Login"
    room i.git.sso proxy "SSO login" port=443 secret=client-secret
building i.portal depot at 89,38 "Admin portal"
  floor i.portal.f "Login"
    room i.portal.sso proxy "SSO login" port=443 secret=client-secret
    room i.portal.roles config "Role mapping"
building j.scheduler tower at 27,80 "Scheduler"
  floor j.sched.f "Cron"
    room j.sched.cron worker "Cron"
    room j.sched.lock config "Leader lock"
building j.broker warehouse at 22,88 "Job queue"
  floor j.broker.f "Queues"
    room j.broker.jobs queue "jobs" port=5672
    room j.broker.retry queue "retries" port=5672
    room j.broker.dead queue "dead letters" port=5672
building j.workers factory at 27,87 "Workers"
  floor j.workers.f "Pool"
    room j.workers.a worker "worker 1"
    room j.workers.b worker "worker 2"
    room j.workers.c worker "worker 3"
building j.results depot at 31,88 "Results"
  floor j.results.f "Storage"
    room j.results.db database "Results DB" port=5432
    room j.results.reports storage "Reports"
building k.orders factory at 40,80 "Orders service"
  floor k.orders.f "Producer"
    room k.orders.api service "Orders API" port=8080
building k.payments factory at 44,80 "Payments service"
  floor k.payments.f "Producer"
    room k.payments.api service "Payments API" port=8080
building k.broker-1 warehouse at 39,86 "Broker 1"
  floor k.b1.f "Broker"
    room k.b1.orders queue "orders p0" port=9092
    room k.b1.payments queue "payments p0" port=9092
building k.broker-2 warehouse at 44,86 "Broker 2"
  floor k.b2.f "Broker"
    room k.b2.orders queue "orders p0 replica" port=9092
    room k.b2.payments queue "payments p0 replica" port=9092
building k.broker-3 warehouse at 40,89 "Broker 3"
  floor k.b3.f "Broker"
    room k.b3.orders queue "orders p0 replica" port=9092
    room k.b3.payments queue "payments p0 replica" port=9092
building k.schema tower at 45,89 "Schema registry"
  floor k.schema.f "Schemas"
    room k.schema.avro config "Avro schemas"
building k.analytics factory at 51,80 "Analytics"
  floor k.analytics.f "Consumer group"
    room k.analytics.spark worker "Stream job"
building k.email factory at 55,80 "Email service"
  floor k.email.f "Consumer group"
    room k.email.worker worker "Sender"
building l.l4 tower at 67,5 "L4, TCP"
  floor l.l4.f "HAProxy"
    room l.l4.ha proxy "HAProxy" port=80,443
    room l.l4.health worker "Health probes"
building l.l7 tower at 70,5 "L7, HTTP"
  floor l.l7.f "Envoy"
    room l.l7.envoy proxy "Envoy" port=8080
    room l.l7.rules config "Routing rules"
building l.web-1 factory at 64,12 "Web 1"
  floor l.web-1.f "Server"
    room l.web-1.app service "App" port=3000
building l.web-2 factory at 68,12 "Web 2"
  floor l.web-2.f "Server"
    room l.web-2.app service "App" port=3000
building l.web-3 factory at 72,12 "Web 3"
  floor l.web-3.f "Server"
    room l.web-3.app service "App, draining" port=3000
building m.shop factory at 53,56 "Shop app"
  floor m.shop.f "App"
    room m.shop.api service "API" port=8080
    room m.shop.exporter worker "Metrics endpoint" port=9100
building m.db warehouse at 57,57 "Database"
  floor m.db.f "Postgres"
    room m.db.pg database "Postgres" port=5432
    room m.db.exporter worker "Postgres exporter"
building m.prom warehouse at 64,56 "Prometheus"
  floor m.prom.f "Metrics"
    room m.prom.scrape worker "Scraper"
    room m.prom.tsdb storage "Time series" port=9090
    room m.prom.rules config "Alert rules"
building m.am tower at 69,56 "Alertmanager"
  floor m.am.f "Routing"
    room m.am.route proxy "Routes and silences" port=9093
building m.grafana depot at 64,59 "Grafana"
  floor m.grafana.f "Dashboards"
    room m.grafana.dash service "Dashboards" port=3000
building m.oncall depot at 68,59 "On-call"
  floor m.oncall.f "People"
    room m.oncall.page service "Pager"
    room m.oncall.chat service "Chat channel"
building n.igw tower at 97,32 "Internet gateway"
  floor n.igw.f "Gateway"
    room n.igw.route config "Route table"
building n.nat tower at 100,32 "NAT gateway"
  floor n.nat.f "NAT"
    room n.nat.out proxy "Outbound NAT"
building n.alb depot at 103,32 "Load balancer"
  floor n.alb.f "Balancer"
    room n.alb.lb proxy "Application LB" port=443
building n.apps factory at 98,37 "App tier"
  floor n.apps.f "Apps"
    room n.apps.api service "API" port=8080
    room n.apps.worker worker "Worker"
building n.cache factory at 102,37 "Cache"
  floor n.cache.f "Cache"
    room n.cache.redis cache "Redis" port=6379
building n.db warehouse at 109,32 "Database"
  floor n.db.f "Postgres"
    room n.db.pg database "Primary" port=5432
    room n.db.replica database "Replica" port=5432
building o.uploads factory at 9,80 "Uploads"
  floor o.uploads.f "App"
    room o.uploads.api service "Upload API" port=8080
building o.s3 tower at 5,86 "S3 gateway"
  floor o.s3.f "API"
    room o.s3.api proxy "S3 API" port=9000
    room o.s3.iam config "Access policies"
building o.node-1 warehouse at 8,86 "Node 1"
  floor o.node-1.f "Disks"
    room o.node-1.d1 storage "Disk 1"
      cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
    room o.node-1.d2 storage "Disk 2"
building o.node-2 warehouse at 13,86 "Node 2"
  floor o.node-2.f "Disks"
    room o.node-2.d1 storage "Disk 1"
      cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
    room o.node-2.d2 storage "Disk 2"
building o.node-3 warehouse at 7,89 "Node 3"
  floor o.node-3.f "Disks"
    room o.node-3.d1 storage "Disk 1"
      cost 90 "Storage server" vendor=Hetzner plan=SX65 spec="4 x 22 TB HDD"
building o.archive depot at 12,89 "Cold archive"
  floor o.archive.f "Glacier"
    room o.archive.vault storage "Archive vault"
      cost 50 "Cold archive" vendor=AWS plan="S3 Glacier Deep Archive" spec="50 TB"
building p.git tower at 17,107 "Git server"
  floor p.git.f "Repositories"
    room p.git.repo storage "shop repo"
building p.registry warehouse at 20,107 "Image registry"
  floor p.registry.f "Images"
    room p.registry.images storage "shop images" port=5000
building p.preview depot at 25,107 "Preview environment"
  floor p.preview.f "Per pull request"
    room p.preview.web service "pr-482" port=3000
building p.staging-stack factory at 5,107 "Staging stack"
  floor p.staging-stack.f "Workloads"
    room p.staging-stack.web service "web" port=3000
    room p.staging-stack.db database "postgres" port=5432
building p.prod-stack factory at 11,107 "Production stack"
  floor p.prod-stack.f "Workloads"
    room p.prod-stack.web service "web" port=3000
    room p.prod-stack.db database "postgres" port=5432
building q.web factory at 82,80 "Web app"
  floor q.web.f "Publisher"
    room q.web.pub service "Order publisher"
building q.exchange tower at 80,88 "Exchange"
  floor q.exchange.f "Routing"
    room q.exchange.topic proxy "orders exchange" port=5672
building q.queues warehouse at 83,88 "Queues"
  floor q.queues.f "Queues"
    room q.queues.orders queue "orders" port=5672
    room q.queues.emails queue "emails" port=5672
    room q.queues.dead queue "dead letters" port=5672
building q.billing factory at 90,80 "Billing"
  floor q.billing.f "Consumer"
    room q.billing.worker worker "Invoice worker"
building q.mailer factory at 94,80 "Mailer"
  floor q.mailer.f "Consumer"
    room q.mailer.worker worker "Email worker"
building r.source tower at 33,107 "Source repo"
  floor r.source.f "Code"
    room r.source.repo storage "shop repo"
building r.registry warehouse at 36,107 "Registry"
  floor r.registry.f "Images"
    room r.registry.images storage "Images" port=5000
    room r.registry.charts storage "Helm charts" port=5000
building r.scanner tower at 33,110 "Scanner"
  floor r.scanner.f "Security"
    room r.scanner.trivy worker "Vulnerability scan"
    room r.scanner.sign worker "Signing" secret=signing-key
building r.mirror depot at 36,110 "Regional mirror"
  floor r.mirror.f "Cache"
    room r.mirror.cache cache "Pull-through cache" port=5000
building r.cluster factory at 43,107 "Cluster"
  floor r.cluster.f "Nodes"
    room r.cluster.kubelet worker "Image pulls"
    room r.cluster.policy config "Only signed images"
building s.kms tower at 96,56 "KMS"
  floor s.kms.f "Auto unseal"
    room s.kms.key config "Master key" secret=master-key
building s.vault-1 depot at 99,56 "Vault 1"
  floor s.vault-1.f "Raft node"
    room s.vault-1.core service "Vault, leader" port=8200 secret=unseal-key
    room s.vault-1.store storage "Encrypted store"
building s.vault-2 depot at 103,56 "Vault 2"
  floor s.vault-2.f "Raft node"
    room s.vault-2.core service "Vault, follower" port=8200 secret=unseal-key
building s.shop factory at 97,61 "Shop"
  floor s.shop.f "App"
    room s.shop.api service "API" port=8080
    room s.shop.agent worker "Vault agent" secret=vault-token
building s.billing factory at 101,61 "Billing"
  floor s.billing.f "App"
    room s.billing.api service "API" port=8080
    room s.billing.agent worker "Vault agent" secret=vault-token
building t.shop factory at 29,56 "Shop app"
  floor t.shop.f "App"
    room t.shop.api service "API" port=8080
    room t.shop.otel worker "OpenTelemetry SDK"
    room t.shop.tail worker "Log tailer"
building t.db warehouse at 33,57 "Database"
  floor t.db.f "Postgres"
    room t.db.pg database "Postgres" port=5432
    room t.db.tail worker "Log tailer"
building t.collector tower at 40,56 "Collector"
  floor t.collector.f "Pipeline"
    room t.collector.otel proxy "OTel collector" port=4317,4318
building t.tempo warehouse at 43,56 "Tempo"
  floor t.tempo.f "Traces"
    room t.tempo.store storage "Trace store" port=3200
building t.loki warehouse at 40,59 "Loki"
  floor t.loki.f "Logs"
    room t.loki.store storage "Log store" port=3100
building t.grafana depot at 45,59 "Grafana"
  floor t.grafana.f "Explore"
    room t.grafana.explore service "Logs and traces"
building u.probe-dub depot at 5,56 "Dublin"
  floor u.probe-dub.f "Probe"
    room u.probe-dub.http worker "HTTP check"
      cost 29 "Uptime checks" vendor="Better Stack" plan=Pro spec="3 regions, 30 s checks"
building u.probe-fra depot at 9,56 "Frankfurt"
  floor u.probe-fra.f "Probe"
    room u.probe-fra.http worker "HTTP check"
building u.probe-iad depot at 13,56 "Virginia"
  floor u.probe-iad.f "Probe"
    room u.probe-iad.http worker "HTTP check"
building u.web factory at 9,61 "Shop"
  floor u.web.f "Public site"
    room u.web.edge proxy "Edge" port=443
    room u.web.app service "App" port=3000
building u.status tower at 19,56 "Status page"
  floor u.status.f "Page"
    room u.status.page service "status.shop.example" port=443
      cost 29 "Status page" vendor=Atlassian plan="Statuspage Startup"
building u.incident tower at 22,56 "Incident channel"
  floor u.incident.f "People"
    room u.incident.chat service "Chat room"
    room u.incident.page service "Pager"
      cost 21 "On-call" vendor=PagerDuty plan=Professional
building v.laptop depot at 38,32 "Engineer laptop"
  floor v.laptop.f "Client"
    room v.laptop.wg service "WireGuard client" secret=private-key
building v.vpn tower at 35,38 "VPN gateway"
  floor v.vpn.f "Tunnel"
    room v.vpn.wg proxy "WireGuard" port=51820 secret=private-key
    room v.vpn.acl config "Allowed networks"
building v.idp tower at 38,38 "Identity provider"
  floor v.idp.f "Login"
    room v.idp.mfa service "MFA"
building v.bastion depot at 41,38 "Bastion"
  floor v.bastion.f "Jump host"
    room v.bastion.ssh proxy "SSH jump host" port=22 secret=host-key
    room v.bastion.audit storage "Session recordings"
building v.servers factory at 47,32 "Servers"
  floor v.servers.f "Private hosts"
    room v.servers.app service "App host" port=8080
    room v.servers.db database "Database host" port=5432
building w.waf tower at 44,5 "WAF"
  floor w.waf.f "Rules"
    room w.waf.rules proxy "OWASP rules" port=443
    room w.waf.bots proxy "Bot filter" port=443
building w.nginx-1 factory at 42,12 "Web 1"
  floor w.nginx-1.f "nginx"
    room w.nginx-1.nginx proxy "nginx" port=80,443
    room w.nginx-1.static storage "Static files"
building w.nginx-2 factory at 46,12 "Web 2"
  floor w.nginx-2.f "nginx"
    room w.nginx-2.nginx proxy "nginx" port=80,443
    room w.nginx-2.static storage "Static files"
building w.app-1 factory at 52,5 "App 1"
  floor w.app-1.f "Runtime"
    room w.app-1.api service "API" port=8080
    room w.app-1.session cache "Sessions" port=6379
building w.app-2 factory at 56,5 "App 2"
  floor w.app-2.f "Runtime"
    room w.app-2.api service "API" port=8080
    room w.app-2.session cache "Sessions" port=6379
building x.dns tower at 23,38 "Global DNS"
  floor x.dns.f "Traffic steering"
    room x.dns.geo config "Geo routing"
    room x.dns.health worker "Region health"
building x.eu-lb tower at 5,33 "EU balancer"
  floor x.eu-lb.f "Entry"
    room x.eu-lb.lb proxy "Load balancer" port=443
building x.eu-app factory at 8,32 "EU app"
  floor x.eu-app.f "App"
    room x.eu-app.api service "API" port=8080
building x.eu-db warehouse at 12,33 "EU database, primary"
  floor x.eu-db.f "Postgres"
    room x.eu-db.pg database "Primary" port=5432
building x.us-lb tower at 19,33 "US balancer"
  floor x.us-lb.f "Entry"
    room x.us-lb.lb proxy "Load balancer" port=443
building x.us-app factory at 22,32 "US app"
  floor x.us-app.f "App"
    room x.us-app.api service "API" port=8080
building x.us-db warehouse at 26,33 "US database, replica"
  floor x.us-db.f "Postgres"
    room x.us-db.pg database "Replica" port=5432
building y.repo tower at 93,107 "Infra repo"
  floor y.repo.f "Terraform"
    room y.repo.modules storage "Modules"
    room y.repo.envs config "Environments"
building y.state warehouse at 96,107 "State"
  floor y.state.f "Remote state"
    room y.state.bucket storage "State file"
    room y.state.lock config "State lock"
building y.network depot at 103,108 "Network"
  floor y.network.f "VPC"
    room y.network.vpc config "VPC and subnets"
    room y.network.dns config "DNS zones" port=53
building y.cluster factory at 107,107 "Kubernetes"
  floor y.cluster.f "Cluster"
    room y.cluster.control service "Control plane" port=6443
    room y.cluster.nodes worker "Node groups"
building y.data factory at 111,107 "Data"
  floor y.data.f "Managed services"
    room y.data.rds database "Postgres" port=5432
    room y.data.cache cache "Redis" port=6379
building z.registry warehouse at 81,107 "Image registry"
  floor z.registry.f "Images"
    room z.registry.v2 storage "shop v2" port=5000
building z.router tower at 86,107 "Traffic router"
  floor z.router.f "Routing"
    room z.router.weights config "Weights 95 / 5"
    room z.router.proxy proxy "Router" port=443
building z.blue factory at 71,107 "Blue, v1"
  floor z.blue.f "Live"
    room z.blue.web service "web v1" port=3000
    room z.blue.db database "Shared database" port=5432
building z.green factory at 75,107 "Green, v2"
  floor z.green.f "Candidate"
    room z.green.web service "web v2" port=3000
    room z.green.metrics worker "Canary analysis"

boundary f.dmz-zone "F · DMZ" members=f.proxy,f.bastion
boundary f.app-zone "F · App zone" members=f.web
boundary f.data-zone "F · Data zone" members=f.db
boundary f.internal "F · Internal network" members=f.app-zone,f.data-zone
boundary i.idp-zone "I · Identity provider" members=i.keycloak,i.directory
boundary i.tools-zone "I · Internal tools" members=i.grafana,i.git,i.portal
boundary n.public-subnet "N · Public subnet" members=n.igw,n.nat,n.alb
boundary n.private-subnet "N · Private subnet" members=n.apps,n.cache
boundary n.isolated-subnet "N · Isolated subnet" members=n.db
boundary n.vpc "N · VPC" members=n.public-subnet,n.private-subnet,n.isolated-subnet
boundary s.vault-zone "S · Vault cluster" members=s.kms,s.vault-1,s.vault-2
boundary s.app-zone "S · Applications" members=s.shop,s.billing
boundary v.outside-zone "V · Outside" members=v.laptop
boundary v.access-zone "V · Access layer" members=v.vpn,v.idp,v.bastion
boundary v.private-zone "V · Private network" members=v.servers
boundary v.corporate "V · Corporate network" members=v.access-zone,v.private-zone
boundary y.code-zone "Y · Code" members=y.repo,y.state
boundary y.vpc "Y · VPC" members=y.network,y.cluster,y.data
boundary y.cloud-account "Y · Cloud account" members=y.vpc
level level-way-in "1 · The way in" members=c.world,c.origin,e.internet,e.edge,e.cluster,w.edge,w.web,w.app,l.front,l.pool,a.front,a.services,h.zone-a,h.zone-b
level level-network "2 · Network and access" members=x.eu,x.us,x.dns,v.outside,v.access,v.inside,f.dmz,f.app,f.data,f.fw-edge,f.fw-core,i.idp,i.tools,n.public,n.private,n.isolated
level level-safe "3 · Safe and watched" members=u.probes,u.service,u.comms,t.hosts,t.telemetry,m.watched,m.watch,b.prod,b.vault,b.drill,s.vault,s.apps
level level-data "4 · Messages and data" members=o.clients,o.store,j.cron,j.pool,k.producers,k.cluster,k.consumers,d.clients,d.data,q.producers,q.broker,q.consumers
level level-delivery "5 · Delivery" members=p.staging,p.prod,p.git,p.registry,p.preview,r.supply,r.runtime,g.source,g.cluster,z.stacks,z.registry,z.router,y.code,y.cloud

gate a.main at 78,10 "api.shop.example" port=443
gate c.visitors at 3,11 "Visitors" port=443
gate e.users at 16,10 "Visitors" port=443
gate f.public at 53,33 "Public" port=443
gate h.users at 94,10 "Public" port=443
gate l.users at 62,10 "Public" port=443
gate n.net at 95,35 "Internet" port=443
gate v.remote at 33,36 "WireGuard" port=51820
gate w.users at 40,10 "Visitors" port=443
road 2,2 -> 116,2 id=street-1-top
road 2,11 -> 15,11 id=lane-c-1
road 15,2 -> 15,18 id=cross-1-1
road 15,10 -> 28,10 id=lane-e-1
road 28,2 -> 28,18 id=lane-e-2
road 39,2 -> 39,18 id=cross-1-2
road 39,10 -> 50,10 id=lane-w-1
road 50,2 -> 50,18 id=lane-w-2
road 61,2 -> 61,18 id=cross-1-3
road 61,10 -> 77,10 id=lane-l-1
road 77,2 -> 77,18 id=cross-1-4
road 77,10 -> 93,10 id=lane-a-1
road 93,2 -> 93,18 id=cross-1-5
road 93,10 -> 109,10 id=lane-h-1
road 2,18 -> 116,18 id=street-1-bottom
road 2,29 -> 116,29 id=street-2-top
road 39,18 -> 39,29 id=avenue-1-39
road 77,18 -> 77,29 id=avenue-1-77
road 17,29 -> 17,42 id=lane-x-1
road 17,36 -> 32,36 id=lane-x-2
road 32,29 -> 32,42 id=cross-2-1
road 32,36 -> 45,36 id=lane-v-1
road 45,29 -> 45,42 id=lane-v-2
road 52,29 -> 52,42 id=cross-2-2
road 63,29 -> 63,42 id=lane-f-1
road 69,29 -> 69,42 id=lane-f-2
road 69,36 -> 78,36 id=lane-f-3
road 78,29 -> 78,42 id=cross-2-3
road 78,36 -> 94,36 id=lane-i-1
road 94,29 -> 94,42 id=cross-2-4
road 94,35 -> 107,35 id=lane-n-1
road 107,29 -> 107,42 id=lane-n-2
road 2,42 -> 116,42 id=street-2-bottom
road 2,53 -> 116,53 id=street-3-top
road 39,42 -> 39,53 id=avenue-2-39
road 77,42 -> 77,53 id=avenue-2-77
road 2,59 -> 17,59 id=lane-u-1
road 17,53 -> 17,66 id=lane-u-2
road 26,53 -> 26,66 id=cross-3-1
road 38,53 -> 38,66 id=lane-t-1
road 50,53 -> 50,66 id=cross-3-2
road 62,53 -> 62,66 id=lane-m-1
road 73,53 -> 73,66 id=cross-3-3
road 73,60 -> 86,60 id=lane-b-1
road 86,53 -> 86,66 id=lane-b-2
road 93,53 -> 93,66 id=cross-3-4
road 93,59 -> 108,59 id=lane-s-1
road 2,66 -> 116,66 id=street-3-bottom
road 2,77 -> 116,77 id=street-4-top
road 39,66 -> 39,77 id=avenue-3-39
road 77,66 -> 77,77 id=avenue-3-77
road 2,84 -> 19,84 id=lane-o-1
road 19,77 -> 19,93 id=cross-4-1
road 19,85 -> 36,85 id=lane-j-1
road 36,77 -> 36,93 id=cross-4-2
road 36,84 -> 49,84 id=lane-k-1
road 49,77 -> 49,93 id=lane-k-2
road 60,77 -> 60,93 id=cross-4-3
road 60,84 -> 77,84 id=lane-d-1
road 77,77 -> 77,93 id=cross-4-4
road 77,86 -> 88,86 id=lane-q-1
road 88,77 -> 88,93 id=lane-q-2
road 2,93 -> 116,93 id=street-4-bottom
road 2,104 -> 116,104 id=street-5-top
road 39,93 -> 39,104 id=avenue-4-39
road 77,93 -> 77,104 id=avenue-4-77
road 9,104 -> 9,114 id=lane-p-1
road 15,104 -> 15,114 id=lane-p-2
road 30,104 -> 30,114 id=cross-5-1
road 41,104 -> 41,114 id=lane-r-1
road 48,104 -> 48,114 id=cross-5-2
road 54,104 -> 54,114 id=lane-g-1
road 68,104 -> 68,114 id=cross-5-3
road 79,104 -> 79,114 id=lane-z-1
road 90,104 -> 90,114 id=cross-5-4
road 101,104 -> 101,114 id=lane-y-1
road 2,114 -> 116,114 id=street-5-bottom
road 2,2 -> 2,114 id=quay-west
road 116,2 -> 116,114 id=quay-east
link a.gw.proxy -> a.gw.auth "verify token" variant=security
link a.gw.proxy -> a.gw.limits "count calls"
link a.gw.proxy -> a.orders.api "REST" variant=emphasis
link a.gw.proxy -> a.catalog.api "REST"
link a.gw.proxy -> a.payments.api "REST"
link a.orders.api -> a.orders.db "SQL"
link a.payments.api -> a.payments.db "SQL" variant=security
link b.db.wal -> b.bucket.wal "WAL archive" variant=dashed
link b.restore.check -> b.restore.pg "verify restore" variant=dashed
link c.pop-bru.cache -> c.shield.cache "cache miss" variant=dashed
link c.pop-ams.cache -> c.shield.cache "cache miss" variant=dashed
link c.pop-par.cache -> c.shield.cache "cache miss" variant=dashed
link c.pop-fra.cache -> c.shield.cache "cache miss" variant=dashed
link c.shield.cache -> c.web.nginx "origin fetch"
link c.web.nginx -> c.web.app "proxy" variant=emphasis
link c.web.nginx -> c.web.assets "static files"
link d.app.rw -> d.pool.bouncer "writes" variant=emphasis
link d.pool.bouncer -> d.primary.pg "writes" variant=emphasis
link d.app.ro -> d.pool.bouncer "reads"
link d.pool.bouncer -> d.replica-a.pg "reads"
link d.primary.wal -> d.replica-a.pg "WAL, sync"
link d.primary.wal -> d.replica-b.pg "WAL, async" variant=dashed
link d.patroni.agent -> d.primary.pg "failover"
link d.patroni.etcd -> d.patroni.agent "leader lease"
link e.dns.zone -> e.shield.ddos "resolves to"
link e.shield.ddos -> e.shield.waf "HTTPS" variant=emphasis
link e.shield.waf -> e.lb.l4 "HTTPS" variant=emphasis
link e.lb.l4 -> e.ingress.nginx "HTTPS" variant=emphasis
link e.ingress.nginx -> e.apps.web "HTTP"
link e.ingress.nginx -> e.apps.api "HTTP"
link e.ingress.cert -> e.dns.certs "ACME" variant=security
link e.lb.health -> e.ingress.nginx "health check" variant=dashed
link f.proxy.nginx -> f.fw-edge.in "allowed: 443" variant=security
link f.fw-edge.in -> f.web.app "allowed: 443" variant=security
link f.web.app -> f.fw-core.db "allowed: 5432" variant=security
link f.fw-core.db -> f.db.pg "allowed: 5432" variant=security
link f.bastion.ssh -> f.web.app "SSH" variant=security
link g.repo.main -> g.argo.sync "git pull" variant=emphasis
link g.argo.diff -> g.shop.web "apply diff"
link g.argo.diff -> g.platform.ingress "apply diff"
link h.lb-a.vip -> h.lb-b.vip "VRRP heartbeat" variant=dashed
link h.lb-a.ha -> h.app-a.api "HTTP" variant=emphasis
link h.lb-a.ha -> h.app-b.api "HTTP"
link h.app-a.api -> h.db-a.pg "SQL" variant=emphasis
link h.app-b.api -> h.db-a.pg "SQL"
link h.db-a.pg -> h.db-b.pg "streaming WAL" variant=dashed
link i.grafana.sso -> i.kc.oidc "OIDC" variant=security
link i.git.sso -> i.kc.oidc "OIDC" variant=security
link i.portal.sso -> i.kc.oidc "OIDC" variant=security
link i.kc.oidc -> i.kc.mfa "second factor" variant=security
link i.kc.oidc -> i.dir.ldap "LDAP bind" variant=security
link i.dir.groups -> i.portal.roles "roles" variant=security
link j.broker.jobs -> j.workers.a "job" variant=emphasis
link j.broker.retry -> j.workers.b "retry" variant=dashed
link j.workers.c -> j.broker.dead "gives up" variant=dashed
link j.workers.a -> j.results.db "result"
link k.orders.api -> k.b1.orders "produce" variant=emphasis
link k.payments.api -> k.b1.payments "produce" variant=emphasis
link k.b1.orders -> k.b2.orders "replicate" variant=dashed
link k.b2.orders -> k.b3.orders "replicate" variant=dashed
link k.b1.payments -> k.b2.payments "replicate" variant=dashed
link k.b2.payments -> k.b3.payments "replicate" variant=dashed
link k.b1.orders -> k.analytics.spark "consume"
link k.b1.payments -> k.email.worker "consume"
link k.schema.avro -> k.b1.orders "schema"
link l.l4.ha -> l.l7.envoy "TCP" variant=emphasis
link l.l7.rules -> l.l7.envoy "routes"
link l.l7.envoy -> l.web-1.app "HTTP" variant=emphasis
link l.l7.envoy -> l.web-2.app "HTTP" variant=emphasis
link l.l7.envoy -> l.web-3.app "draining" variant=dashed
link l.l4.health -> l.web-1.app "probe" variant=dashed
link l.l4.health -> l.web-2.app "probe" variant=dashed
link l.l4.health -> l.web-3.app "probe" variant=dashed
link m.shop.exporter -> m.prom.scrape "scrape" variant=dashed
link m.db.exporter -> m.prom.scrape "scrape" variant=dashed
link m.prom.rules -> m.am.route "firing alert" variant=emphasis
link m.grafana.dash -> m.prom.tsdb "PromQL"
link n.igw.route -> n.alb.lb "HTTPS" variant=emphasis
link n.alb.lb -> n.apps.api "HTTP" variant=security
link n.apps.api -> n.db.pg "SQL" variant=security
link n.apps.api -> n.cache.redis "cache"
link n.apps.worker -> n.nat.out "outbound" variant=dashed
link n.db.pg -> n.db.replica "replication" variant=dashed
link o.uploads.api -> o.s3.api "S3 PUT" variant=emphasis
link o.s3.iam -> o.s3.api "policy" variant=security
link o.s3.api -> o.node-1.d1 "erasure shards"
link o.node-1.d1 -> o.node-2.d1 "shard copy" variant=dashed
link o.node-2.d1 -> o.node-3.d1 "shard copy" variant=dashed
link q.web.pub -> q.exchange.topic "publish" variant=emphasis
link q.exchange.topic -> q.queues.orders "route: orders" variant=emphasis
link q.queues.orders -> q.billing.worker "consume" variant=emphasis
link q.exchange.topic -> q.queues.emails "route: emails"
link q.queues.emails -> q.mailer.worker "consume"
link q.queues.orders -> q.queues.dead "failed" variant=dashed
link r.cluster.kubelet -> r.mirror.cache "pull image" variant=emphasis
link r.cluster.policy -> r.scanner.sign "verify signature" variant=security
link r.scanner.trivy -> r.registry.images "scan"
link s.kms.key -> s.vault-1.core "auto unseal" variant=security
link s.vault-1.core -> s.vault-2.core "Raft replication" variant=dashed
link s.shop.agent -> s.vault-1.core "fetch lease" variant=security
link s.billing.agent -> s.vault-1.core "fetch lease" variant=security
link s.shop.agent -> s.shop.api "hands over" variant=security
link t.shop.otel -> t.collector.otel "OTLP" variant=emphasis
link t.collector.otel -> t.tempo.store "traces"
link t.grafana.explore -> t.loki.store "LogQL"
link t.grafana.explore -> t.tempo.store "TraceQL"
link u.probe-dub.http -> u.web.edge "HTTPS check" variant=dashed
link u.probe-fra.http -> u.web.edge "HTTPS check" variant=dashed
link u.probe-iad.http -> u.web.edge "HTTPS check" variant=dashed
link u.web.edge -> u.web.app "HTTP" variant=emphasis
link u.incident.page -> u.incident.chat "page"
link v.laptop.wg -> v.vpn.wg "WireGuard" variant=security
link v.vpn.wg -> v.idp.mfa "MFA" variant=security
link v.vpn.acl -> v.vpn.wg "allowed networks"
link v.vpn.wg -> v.bastion.ssh "SSH" variant=security
link v.bastion.ssh -> v.servers.app "SSH" variant=security
link v.bastion.ssh -> v.servers.db "SSH" variant=security
link v.bastion.ssh -> v.bastion.audit "records session"
link w.waf.rules -> w.waf.bots "allowed"
link w.waf.bots -> w.nginx-1.nginx "HTTPS" variant=emphasis
link w.waf.bots -> w.nginx-2.nginx "HTTPS" variant=emphasis
link w.nginx-1.nginx -> w.app-1.api "HTTP" variant=emphasis
link w.nginx-2.nginx -> w.app-2.api "HTTP" variant=emphasis
link w.app-1.api -> w.app-1.session "session"
link w.app-2.api -> w.app-2.session "session"
link x.dns.geo -> x.eu-lb.lb "DNS: EU" variant=emphasis
link x.dns.geo -> x.us-lb.lb "DNS: standby" variant=dashed
link x.dns.health -> x.eu-lb.lb "health check" variant=dashed
link x.eu-lb.lb -> x.eu-app.api "HTTP" variant=emphasis
link x.eu-app.api -> x.eu-db.pg "SQL" variant=emphasis
link x.us-lb.lb -> x.us-app.api "HTTP"
link x.us-app.api -> x.us-db.pg "SQL"
link x.eu-db.pg -> x.us-db.pg "cross-region WAL" variant=dashed
link y.repo.envs -> y.state.lock "lock state"
link y.repo.modules -> y.network.vpc "apply" variant=security
link y.repo.modules -> y.cluster.control "apply" variant=security
link y.repo.modules -> y.data.rds "apply" variant=security
link z.router.proxy -> z.blue.web "95% of traffic" variant=emphasis
link z.router.proxy -> z.green.web "5% canary" variant=dashed
link z.router.weights -> z.router.proxy "weights"
link z.green.metrics -> z.router.weights "promote or abort"
link z.blue.web -> z.blue.db "SQL"
link z.green.web -> z.blue.db "SQL"
pipeline b.nightly "Nightly backup" b.db -> [snapshot] -> [encrypt] -> [upload] -> b.bucket -> [replicate] -> b.copy
  step b.db "The database is copied at night"
  run snapshot "pg_basebackup -D /backup/$DATE -Ft -z"
  run encrypt "age -r $BACKUP_RECIPIENT -o base.tar.gz.age /backup/$DATE/base.tar.gz"
  run upload "aws s3 cp base.tar.gz.age s3://shop-backups/$DATE/"
  step b.bucket "The copy is stored in a safe bucket"
  step b.copy "A second copy is kept in another place"
pipeline b.drill-run "Monthly restore drill" b.bucket -> [fetch] -> [restore] -> [verify] -> b.restore
  step b.bucket "A stored backup is taken out"
  run fetch "aws s3 cp s3://shop-backups/latest/ . --recursive"
  run restore "age -d -i $BACKUP_KEY base.tar.gz.age | tar -xzf - -C ./restored && pg_ctl -D ./restored start"
  run verify "psql -c 'select count(*) from orders'"
  step b.restore "It is restored into a test database, to prove it works"
pipeline g.sync-shop "Sync shop" g.repo -> [poll] -> [diff] -> [apply] -> g.shop
  step g.repo "A change is saved in the configuration repository"
  run poll "git fetch origin main"
  run diff "kubectl diff -f apps/shop/"
  run apply "kubectl apply -f apps/shop/ --prune -l app=shop"
  step g.shop "The shop's cluster is updated to match it"
pipeline g.sync-platform "Sync platform" g.repo -> [poll] -> [diff] -> [apply] -> g.platform
  step g.repo "A change is saved in the configuration repository"
  run poll "git fetch origin main"
  run diff "kubectl diff -f platform/"
  run apply "kubectl apply -f platform/ --prune -l tier=platform"
  step g.platform "The platform's cluster is updated to match it"
pipeline j.nightly "Nightly jobs" j.scheduler -> [enqueue] -> j.broker -> [process] -> j.workers -> [report] -> j.results
  step j.scheduler "A timer starts the nightly work"
  step j.broker "The jobs wait in a queue"
  step j.workers "Workers pick them up and do them"
  step j.results "The results are saved"
pipeline m.alert "Alert path" m.prom -> [evaluate] -> [group] -> [route] -> m.oncall
  step m.prom "Prometheus notices that something is wrong"
  step m.oncall "The person on call is told"
pipeline o.lifecycle "Object lifecycle" o.s3 -> [warm-after-30d] -> [archive-after-1y] -> o.archive
  step o.s3 "A file is stored in fast storage"
  step o.archive "After a year it moves to cheap archive storage"
pipeline p.pr-checks "Pull request checks" p.git -> [lint] -> [unit-tests] -> [build] -> p.preview
  step p.git "A developer opens a pull request"
  run lint "npm run lint"
  run unit-tests "npm test"
  run build "docker build -t shop:pr-$PR ."
  step p.preview "The change is checked and a preview is built to try"
pipeline p.release "Release to production" p.git -> [build] -> [test] -> [scan] -> [push] -> p.registry -> [deploy-staging] -> [smoke] -> p.staging -> [approve] -> [promote] -> p.prod
  step p.git "A change is merged"
  run build "docker build -t registry.shop.example/shop:$SHA ."
  run test "docker run --rm registry.shop.example/shop:$SHA npm test"
  run scan "trivy image --exit-code 1 registry.shop.example/shop:$SHA"
  run push "docker push registry.shop.example/shop:$SHA"
  step p.registry "The tested change is stored as a package"
  run deploy-staging "helm upgrade --install shop ./chart -n staging --set image.tag=$SHA"
  run smoke "./scripts/smoke.sh https://staging.shop.example"
  step p.staging "It is tried on a copy of the shop"
  run promote "helm upgrade --install shop ./chart -n prod --set image.tag=$SHA"
  step p.prod "A person approves it and it goes live"
pipeline r.publish "Publish an image" r.source -> [build] -> [scan] -> [sign] -> [push] -> r.registry -> [replicate] -> r.mirror
  step r.source "A change to the image's recipe is merged"
  run build "docker build -t registry.shop.example/shop:$SHA ."
  run scan "trivy image --exit-code 1 registry.shop.example/shop:$SHA"
  run sign "cosign sign --key $COSIGN_KEY registry.shop.example/shop:$SHA"
  run push "docker push registry.shop.example/shop:$SHA"
  step r.registry "The image is built, scanned, signed and stored"
  run replicate "skopeo copy docker://registry.shop.example/shop:$SHA docker://mirror.shop.example/shop:$SHA"
  step r.mirror "A copy is kept close to where it is used"
pipeline s.rotate "Rotate the database password" s.vault-1 -> [generate] -> [update-database] -> [distribute] -> [revoke-old] -> s.shop
  step s.vault-1 "The vault creates a new database password"
  step s.shop "The shop gets the new password and the old one stops working"
pipeline t.log-path "Log path" t.shop -> [tail] -> [parse] -> [ship] -> t.loki
  step t.shop "The shop writes its log lines"
  step t.loki "The logs are collected, so anyone can search them"
pipeline t.trace-path "Trace path" t.shop -> [instrument] -> [sample] -> [export] -> t.tempo
  step t.shop "A request is followed through the shop"
  step t.tempo "The trace is stored, to see where time was lost"
pipeline u.incident-flow "Incident" u.probe-dub -> [3-failures] -> [alert] -> [open-incident] -> [update-status] -> u.status
  step u.probe-dub "A check from Dublin fails three times in a row"
  step u.status "The status page tells customers there is a problem"
pipeline x.failover "Region failover" x.dns -> [detect-outage] -> [promote-replica] -> [repoint-dns] -> x.us-lb
  step x.dns "The monitor sees that the main region is down"
  step x.us-lb "Customers are sent to the backup region"
pipeline y.plan "Plan on pull request" y.repo -> [fmt] -> [validate] -> [plan] -> [policy-check] -> y.state
  step y.repo "A change to the infrastructure is proposed"
  run fmt "terraform fmt -check -recursive"
  run validate "terraform init -backend=false"
  run validate "terraform validate"
  run plan "terraform plan -out=tfplan"
  run policy-check "terraform show -json tfplan > tfplan.json"
  run policy-check "conftest test tfplan.json"
  step y.state "The plan says what would change, and the policy checks it"
pipeline y.apply "Apply on merge" y.repo -> [plan] -> [approve] -> [apply] -> y.cloud
  step y.repo "The change is approved and merged"
  run plan "terraform plan -out=tfplan"
  run apply "terraform apply tfplan"
  step y.cloud "The change is applied to the real cloud"
pipeline z.rollout "Canary rollout" z.registry -> [deploy-green] -> [canary-5] -> [analyse] -> [shift-50] -> [shift-100] -> z.green
  step z.registry "A new version is ready"
  run deploy-green "kubectl apply -f green/"
  run canary-5 "kubectl argo rollouts set weight shop 5"
  run analyse "kubectl argo rollouts status shop --timeout 10m"
  run shift-50 "kubectl argo rollouts set weight shop 50"
  run shift-100 "kubectl argo rollouts promote shop --full"
  step z.green "It runs next to the old one and takes more traffic, step by step"
pipeline z.rollback "Rollback" z.router -> [flip-weights] -> z.blue
  step z.router "Something is wrong with the new version"
  run flip-weights "kubectl argo rollouts abort shop"
  step z.blue "Traffic goes back to the old version"

%% ---- The flows that join the parts ----

%% A request, from a visitor's browser to the row in the database.
pipeline request "A request, end to end" c.pop-ams -> [cache-miss] -> e.shield -> [filter] -> w.waf -> [terminate-tls] -> l.l7 -> [balance] -> a.gateway -> [authorise] -> a.orders -> [query] -> d.primary
  step c.pop-ams "A visitor's request reaches the nearest edge location"
  step e.shield "It is checked once more before it gets near the shop"
  step w.waf "Attacks and bots are filtered out"
  step l.l7 "The secure connection ends here and the request is shared out"
  step a.gateway "The gateway checks who is asking and what they may do"
  step a.orders "The orders service does the work"
  step d.primary "The order is read from, or saved in, the main database"

%% An order becomes events: published, queued, streamed, worked on and archived.
pipeline events "An order's events" a.orders -> [publish] -> q.exchange -> [route] -> q.queues -> [stream] -> k.broker-1 -> [consume] -> j.workers -> [archive] -> o.s3
  step a.orders "A customer's order is placed"
  step q.exchange "The order is announced to whoever needs to know"
  step q.queues "Each team gets its own line of work to pick up"
  step k.broker-1 "The events are kept in order, so nothing is lost"
  step j.workers "Background workers do the follow-up work, such as emails"
  step o.s3 "A copy is kept for audits and reports"

%% A commit becomes a running canary.
pipeline delivery "From commit to canary" p.git -> [build] -> [test] -> [scan] -> [push] -> r.registry -> [replicate] -> r.mirror -> [pull] -> g.argo -> [sync] -> z.green -> [shift-traffic] -> z.router
  step p.git "A developer merges a change"
  step r.registry "The tested change is packaged and stored"
  step r.mirror "A copy is kept in every region, ready to ship"
  step g.argo "The deployment tool notices the new version"
  step z.green "The new version starts next to the old one"
  step z.router "A few customers are moved to it, then more"
  run build "docker build -t registry.shop.example/shop:$SHA ."
  run test "docker run --rm registry.shop.example/shop:$SHA npm test"
  run push "docker push registry.shop.example/shop:$SHA"
  run sync "argocd app sync shop"

%% The network itself is code too.
pipeline provision "Build the network" y.repo -> [plan] -> [apply] -> n.igw -> [route] -> n.alb
  step y.repo "A change to the network is written as code and reviewed"
  step n.igw "The internet connection is created"
  step n.alb "The load balancer that serves customers is ready"
  run plan "terraform plan -out=tfplan"
  run apply "terraform apply tfplan"

%% Data leaves the building: archived, then copied to another region.
pipeline offsite "Off-site copy" d.primary -> [archive-wal] -> b.bucket -> [replicate-region] -> x.us-db
  step d.primary "Every change to the main database is recorded"
  step b.bucket "The records are stored in a safe bucket"
  step x.us-db "A second region keeps a live copy, in case the first is lost"

%% Serving: who hands requests to whom.
link x.dns.geo -> e.dns.zone "DNS"
link e.lb.l4 -> l.l4.ha "TCP" variant=emphasis
link l.l7.envoy -> h.lb-a.ha "HTTP" variant=emphasis
link a.gw.proxy -> h.app-a.api "HTTP" variant=emphasis
link n.alb.lb -> a.gw.proxy "HTTP"

%% Security: who is trusted, who holds the keys, what may reach the database.
link i.kc.oidc -> a.gw.auth "OIDC" variant=security
link s.vault-1.core -> a.gw.auth "signing key" variant=security
link s.vault-1.core -> d.primary.pg "DB credential" variant=security
link v.idp.mfa -> i.kc.mfa "MFA" variant=security
link v.bastion.ssh -> f.bastion.ssh "SSH" variant=security
link f.fw-core.db -> d.primary.pg "allowed: 5432" variant=security

%% Data protection.
link d.primary.wal -> b.bucket.wal "WAL archive" variant=dashed
link f.db.backup -> b.bucket.snap "snapshot" variant=dashed

%% Watching: numbers, traces, probes from outside, and who gets paged.
link a.gw.proxy -> m.prom.scrape "scrape" variant=dashed
link d.primary.pg -> m.prom.scrape "scrape" variant=dashed
link k.b1.orders -> m.prom.scrape "scrape" variant=dashed
link l.l7.envoy -> m.prom.scrape "scrape" variant=dashed
link a.gw.proxy -> t.collector.otel "OTLP"
link j.workers.a -> t.collector.otel "OTLP"
link u.probe-dub.http -> e.lb.l4 "HTTPS check" variant=dashed
link m.am.route -> u.incident.page "page"