Skip to content
Connect an agent

Get started

Architecture patterns

A pattern is a ready-made, checked diagram for a common architecture: a three-tier network, a two-zone network, a serverless API, a delivery pipeline, a sign-in flow, a starter database schema. An agent finds the one that fits the request, renames the parts, and has a diagram that already validates with no warnings. It is written for an AI agent first, so each step names the tool to call and says what comes back. A person can follow the same steps by hand and copy the source from any picture below.

TL;DR

QuestionAnswer
Why start from a pattern?The groups, icons, edge styles, and layout are already right, so the work is naming things, not drawing them. Every pattern validates with no warnings in every flavour.
How do I find one?Call find_pattern with the request in plain words, such as serverless api or two availability zones. The best match is first.
What do I get back?An id, a title, a one-sentence summary, the providers it comes in, and tags. Never the source, so a search stays small.
How do I read one?Call get_pattern with the id and a flavour in provider. It returns the source, every slot with its meaning, advice on what to keep, rename, and split, and the diagram as a tree.
How do I draw one?Call draw_from_pattern with the id, a flavour, and the slot values you want to change. It fills, validates, and renders in one call.
What is a slot?A named part of the diagram, such as office or database. A slot value replaces the label and nothing else, so it can never break the source.
What is a flavour?The way a pattern is drawn. Every pattern has a neutral flavour, with generic icons, and many also have one provider's flavour: aws, azure, or gcp. You choose it with the provider field.
Which pattern is too small or too big?Start from the closest one. If the request needs more than about 25 nodes, draw two diagrams and say so; each pattern says where to split.

1. The recipe

Follow these steps in order. Each one ends with a check.

  1. Find the pattern. Call find_pattern with the words of the request. Add provider to keep only the patterns that come in that flavour, kind for flow, sequence, or schema, and tags to require a tag. Read the summaries and pick one. If nothing fits, write the diagram from the language reference instead.
  2. Read it. Call get_pattern with the id and the flavour you want in provider. A flavour the pattern does not have is a problem that lists the ones it has. Read the slots, then the three notes: what to keep, what to rename, and when to split.
  3. Choose the slot values. Use the names from the request. A value is plain text of at most 60 characters, with no quotes, backslashes, or line breaks. A value that breaks a rule comes back as a problem with the slot named, never as an exception.
  4. Draw it. Call draw_from_pattern with the id, the flavour, and the values. It returns valid, the warnings, a summary for the picture's description, an outline to check against the request, and the SVG for the schemes you asked for.
  5. Adapt what the slots cannot. To add a node, remove a service, or change an edge, take the source that get_pattern returned, edit it, and call validate_diagram until no warning is left. Keep the shape of the groups: they carry the meaning.
  6. Check the outline. Call outline_diagram, or read the outline in the answer, and compare it with the request line by line. Every service the request names is a node, and every node is something the request names.

A session for the request "a serverless API with a queue for slow work, on Google Cloud" looks like this:

CallInputWhat comes back
find_pattern{"query": "serverless api queue", "provider": "gcp"}serverless-api first, with its summary and tags
get_pattern{"id": "serverless-api", "provider": "gcp"}The source, the slots, the notes, and the group tree
draw_from_pattern{"id": "serverless-api", "provider": "gcp", "slots": {"title": "Order API"}}valid: true, no warnings, an outline, and the SVG

2. Slots

A slot is a named part of a pattern. Every pattern has title and description: the first is the name of the diagram, and the second is the sentence that a screen reader reads in place of the picture. The others are named for what they hold, such as office, load-balancer, or primary-database.

RuleWhy
A slot value replaces a label or a second line, nothing elseA value cannot change an id, a type, an icon, or an arrow, so a bad value cannot break the diagram.
A value has at most 60 characters, except descriptionA box grows to fit its text, and a long label makes the diagram wide.
A value has no quotes, backslashes, or line breaksThe label is a quoted text in the source.
An unknown slot is a problem with the nearest slot nameoffice and ofice are one letter apart; the answer says which you meant.
A slot that is not set keeps its defaultThe defaults are placeholders such as Web tier and 10.0.0.0/16, drawn in the pictures below.

A slot used in several places, such as the name of a load balancer drawn once for each tier, is set once and changes everywhere.

3. The patterns

PatternUse it forIdFlavours
Three-tier network behind load balancersAn office network joins a cloud network through a VPN gateway, and three tiers each put a load balancer in front of a redundant set of machines.three-tier-networkNeutral, Azure
Two-zone network with a replicated databaseA network spans two availability zones, each with a public, a private, and an isolated subnet, joined by one balancer set, one scaling group, and a replicated database.two-zone-networkNeutral, AWS
Hub and spoke networkA hub network with a firewall and shared services links an office to several isolated spoke networks, so all traffic between them passes one place.hub-and-spoke-networkNeutral, AWS, Azure, Google Cloud
Zero trust access to private appsPeople on managed devices reach private apps only through an identity-aware access proxy, whose policy engine checks the user, multi-factor sign-in, and device health on every request and logs each decision to a SIEM.zero-trust-accessNeutral, AWS, Azure, Google Cloud
Segmented cardholder data environmentCard payments pass a web application firewall and a DMZ, then a segmentation firewall into a small cardholder data environment that tokenises card numbers and keeps them in an encrypted vault, so the rest of the company only ever sees tokens.pci-cardholder-data-environmentNeutral, AWS, Azure, Google Cloud
Web application on a cloudA single-page app is served through a CDN, backed by an API on a hosting plan, a database, a queue and worker, identity, storage, a delivery pipeline, and monitoring.web-app-on-cloudNeutral, Azure
Three-tier web app behind a WAFUsers reach a web tier through DNS, a CDN, a web application firewall, and a load balancer, and an app tier behind it uses a primary database with a read replica, a cache, object storage, a secrets store, and monitoring.web-app-behind-wafNeutral, AWS, Azure, Google Cloud
Serverless APIA client calls an API gateway that checks sign-in and routes to three functions, which keep records in a managed database and files in object storage.serverless-apiNeutral, AWS, Google Cloud
Microservices behind an API gatewayClients call one API gateway that checks identity and routes to small services, which talk to each other through a message bus and each keep their own database.microservices-gatewayNeutral, AWS, Azure, Google Cloud
Container platformA delivery pipeline pushes images to a registry, and a managed cluster runs three services on a redundant node pool behind an ingress, with configuration, secrets, and monitoring.container-platformNeutral, Google Cloud
Queue and worker poolA web API puts jobs on a queue, a pool of workers takes them and writes results to a database, failed jobs go to a dead-letter queue, and an alarm watches the queue depth.queue-workerNeutral, AWS
Event-driven pipelineSeveral services publish events to an event bus, three independent consumers react to them, and events that keep failing go to a dead-letter queue.event-driven-pipelineNeutral, AWS, Azure, Google Cloud
Static site behind a CDNVisitors resolve a name through DNS and reach a content delivery network with a certificate, which serves files from a storage bucket that a build pipeline updates and clears from the cache.static-site-cdnNeutral, AWS
Data lake and analyticsSources feed an ingestion stage into a raw zone, a processing stage cleans the data into a curated zone, and a warehouse serves analysts through dashboards, with a catalog that describes the datasets.data-lake-analyticsNeutral, AWS, Azure, Google Cloud
Retrieval-augmented AI applicationAn app sends prompts through an AI gateway and input guardrails to a retrieval service, which adds the nearest chunks from a vector store before a managed model answers, with output guardrails on the answer and an audit log of every prompt and answer.ai-rag-applicationNeutral, AWS, Azure, Google Cloud
Multi-region failoverA global routing service sends users to a primary region and fails over to a standby region, which holds replicated data and an identical stack.multi-region-failoverNeutral, AWS, Azure, Google Cloud
Monitoring and observability stackApplications and hosts send metrics, logs, and traces through one OpenTelemetry collector to a store for each signal, which dashboards read and alert rules watch to page the on-call engineer.observability-stackNeutral, AWS, Azure, Google Cloud
Internal developer platformDevelopers create a service from a golden-path template in a portal, and its code and infrastructure reach development, staging, and production clusters through continuous integration and policy checks, with shared secrets, observability, and cost reporting.internal-developer-platformNeutral, AWS, Azure, Google Cloud
CI/CD delivery pipeline with an approval gateA commit is built, tested, scanned, and stored as an image, then deployed to staging, held for an approval, and released to production.ci-cd-delivery-pipelineNeutral, Azure
GitOps delivery to clustersA pipeline builds, tests, and scans an image and writes its tag to a config repository, and a GitOps controller syncs the development, staging, and production clusters from it, with a promotion and an approval on the way.gitops-kubernetes-deliveryNeutral, AWS, Azure, Google Cloud
Sign-in with an authorization code and proof keyA browser app signs a person in through an identity provider with the authorization code flow and a proof key, calls a backend API with the access token, and refreshes it when it expires.sign-in-token-flowNeutral
Single sign-on and SCIM provisioningA customer's identity provider signs people in to a SaaS app with SAML or OIDC and creates, updates, and deactivates their accounts over SCIM, while the app maps groups to roles and audits every change.sso-scim-integrationNeutral, AWS, Azure, Google Cloud
Multi-tenant application schemaOrganizations own projects and an audit log, and users join organizations through a memberships table that carries a role.database-schema-starterNeutral

Every id is stable. Tools and links use it, so it never changes.

Each pattern is drawn below in its neutral flavour, with its slots. The defaults are placeholders: documentation address ranges such as 192.0.2.0/24 and generic names such as web-tier.

Three-tier network behind load balancers

An office network joins a cloud network through a VPN gateway, and three tiers each put a load balancer in front of a redundant set of machines.

When to use it. Start here when the request is a classic web, application, and data layering inside a private network, especially when an office or data center connects to it. It shows what each tier holds, where the redundancy is, and the one way operators get in.

Id and flavours. three-tier-network, drawn below in its neutral flavour. It also comes in: Azure.

SlotDefaultWhat goes there
officeOffice networkThe network on your side of the link: an office, a data center, or a branch.
workstationsStaff workstationsWho or what uses the system from the office side.
office-gatewayOffice gatewayThe router or firewall that ends the link on your side.
linkGateway subnetThe subnet that holds the cloud end of the link.
link-address10.0.0.0/27The address range of that subnet, as a plain sample value.
vpn-gatewayVPN gatewayThe cloud end of the link between the office and the cloud network.
cloudCloud sideThe name of the cloud network that everything else sits in.
cloud-address10.0.0.0/16The address range of the whole cloud network.
web-tierWeb tierThe first tier, which users reach.
web-address10.0.1.0/24The address range of the web tier.
app-tierApplication tierThe middle tier, which runs the application code.
app-address10.0.2.0/24The address range of the application tier.
data-tierData tierThe last tier, which holds the data.
data-address10.0.3.0/24The address range of the data tier.
load-balancerLoad balancerThe name of the balancer in front of each tier.
web-machineWebWhat a machine of the web tier is called; a number follows it.
app-machineAppWhat a machine of the application tier is called; a number follows it.
data-machineDataWhat a machine of the data tier is called; a number follows it.
web-setWeb machinesThe name of the redundant set in the web tier.
app-setApplication machinesThe name of the redundant set in the application tier.
data-setData machinesThe name of the redundant set in the data tier.
managementManagement subnetThe subnet operators use to reach the machines.
management-address10.0.4.0/27The address range of the management subnet.
jump-hostJump hostThe one machine operators sign in to.

Keep. Keep the order of the tiers, the edge from the middle machine of one tier to the load balancer of the next (it keeps the tiers level), the three overlays, and direction=down. Keep every machine in a tier as a member of that tier's overlay.

Rename. Rename the tiers, the machines, and the address ranges through the slots. Change the number of machines by adding a node, an edge from the load balancer, and the member id in the overlay, in all three places. Swap the generic icons for a provider's with the flavour you pick.

Split. Past about four machines in a tier, or a fourth tier, draw the tier alone in its own diagram and keep one machine of it here. Draw the management and monitoring paths in a second diagram if they pull in more than two nodes.

Two-zone network with a replicated database

A network spans two availability zones, each with a public, a private, and an isolated subnet, joined by one balancer set, one scaling group, and a replicated database.

When to use it. Start here when the request is a network that survives the loss of a zone: public subnets for the balancers, private subnets for the servers, isolated subnets for the data. It shows which resources are per zone, which span both, and how the data is kept in step.

Id and flavours. two-zone-network, drawn below in its neutral flavour. It also comes in: AWS.

SlotDefaultWhat goes there
internetInternetWhere the traffic comes from.
cloudCloudThe outermost frame: the provider cloud, or your account in it.
gatewayInternet gatewayThe gateway that connects the network to the internet.
networkApplication networkThe private network that holds both zones.
network-address10.0.0.0/16The address range of the network, as a plain sample value.
zone-aZone AThe name of the first availability zone.
zone-bZone BThe name of the second availability zone.
public-aPublic subnet AThe public subnet of the first zone.
public-a-address10.0.0.0/24The address range of that subnet.
public-bPublic subnet BThe public subnet of the second zone.
public-b-address10.0.10.0/24The address range of that subnet.
private-aPrivate subnet AThe private subnet of the first zone, which holds the application server.
private-a-address10.0.1.0/24The address range of that subnet.
private-bPrivate subnet BThe private subnet of the second zone, which holds the application server.
private-b-address10.0.11.0/24The address range of that subnet.
isolated-aIsolated subnet AThe isolated subnet of the first zone, which holds the database.
isolated-a-address10.0.2.0/24The address range of that subnet.
isolated-bIsolated subnet BThe isolated subnet of the second zone, which holds the database.
isolated-b-address10.0.12.0/24The address range of that subnet.
balancerLoad balancerThe name of the balancer; a zone letter follows it on each node, and it names the dashed set that spans both zones.
serverApplication serverWhat the server in each private subnet is called; a zone letter follows it.
scalingScaling groupThe name of the dashed set that spans the servers of both zones.
primaryPrimary databaseThe database that takes the writes, in the first zone.
replicaReplica databaseThe database that follows the primary, in the second zone.
replicationreplicationWhat the dotted link between the two databases carries.

Keep. Keep both zones as siblings with the same three subnets in the same order, one node in each subnet, and the two dashed sets: they are what shows the balancer and the scaling group span both zones. Keep the replication link between the two databases.

Rename. Rename the zones, subnets, and resources through the slots, and replace the sample address ranges with the real ones. Give a subnet more than one node by adding nodes inside it and edges to them; add the new servers to the scaling set's members.

Split. Past about three nodes in a subnet, or a third zone, draw one zone alone in a second diagram and show only the balancer, one server, and the database here. Draw the outbound path (a NAT gateway and the routes) in its own diagram.

Hub and spoke network

A hub network with a firewall and shared services links an office to several isolated spoke networks, so all traffic between them passes one place.

When to use it. Start here when several workloads need their own networks but share connectivity, security, and services: each workload gets a spoke, and the hub holds what they share. It shows that spokes reach each other and the office only through the hub firewall.

Id and flavours. hub-and-spoke-network, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
staffStaffWho uses the workloads from the office.
officeOffice networkThe network on your side of the link.
office-gatewayOffice gatewayThe router or firewall that ends the link on your side.
cloudCloud sideThe name of the frame around the hub and the spokes.
hubHub networkThe shared network every spoke connects through.
hub-address10.0.0.0/22The address range of the hub, as a plain sample value.
vpn-gatewayVPN gatewayThe cloud end of the link to the office.
firewallCentral firewallThe firewall every route between networks passes.
sharedShared servicesThe services every spoke uses, such as name resolution and directory.
spoke-aSpoke AThe name of the first spoke network.
spoke-a-address10.1.0.0/20The address range of the first spoke.
spoke-bSpoke BThe name of the second spoke network.
spoke-b-address10.2.0.0/20The address range of the second spoke.
spoke-cSpoke CThe name of the third spoke network.
spoke-c-address10.3.0.0/20The address range of the third spoke.
workload-aOrders applicationThe workload that runs in the first spoke.
workload-bReporting applicationThe workload that runs in the second spoke.
workload-cPartner portalThe workload that runs in the third spoke.
databaseDatabaseThe database each spoke keeps for its workload.

Keep. Keep every spoke connected to the hub firewall and to nothing else outside its own group: that is what the pattern says. Keep the hub in its own tone, and keep the office behind the gateway.

Rename. Rename the spokes after the workloads or teams that own them, and give each its real address range. Add a spoke by copying one group, its two nodes, and its two edges.

Split. Past about five spokes, draw the hub with two spokes here and list the others in a table, or draw a second hub for a second region in its own diagram.

Zero trust access to private apps

People on managed devices reach private apps only through an identity-aware access proxy, whose policy engine checks the user, multi-factor sign-in, and device health on every request and logs each decision to a SIEM.

When to use it. Start here when staff or contractors need internal apps without a VPN that puts them on the network: every request is checked for who the person is and what state their device is in. It shows that the apps have no public address and that the proxy is the only way in. Start from the hub and spoke pattern instead when the question is how networks connect, not how people are let in.

Id and flavours. zero-trust-access, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
workforceWorkforceThe name of the group that holds the people and their devices.
usersStaff and contractorsWho signs in to reach the private apps.
deviceManaged deviceThe laptop or phone a person works from.
device-subLaptop or phoneA second line that says what kind of device it is.
trustTrust signalsThe name of the group that holds the identity and device checks.
identityIdentity providerThe directory that signs people in and holds their groups.
device-managementDevice managementThe service that enrols devices and reports whether each one is healthy.
private-appsPrivate appsThe name of the network that holds the apps, which has no public address.
private-address10.20.0.0/16The address range of the private network, as a plain sample value.
app-aInternal wikiThe first private app.
app-bAdmin consoleThe second private app.
app-cFinance databaseThe data store that only some groups may reach.
siemSIEMThe security monitoring system that keeps and searches the access logs.

Keep. Keep the access proxy as the only edge into the private apps, the policy engine asking both the identity provider and device management on every request, and the dotted line from the proxy to the access logs and the SIEM. The proxy, the policy engine, and the access logs are fixed parts because they are what makes the access zero trust; keep direction=down.

Rename. Rename the people, the device, the identity provider, the device management service, the private apps, and the address range through the slots. Add an app by adding a node in the private group and an edge from the proxy. Pick the aws, azure, or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Draw the policy rules themselves, such as which group reaches which app from which device state, as a table or a second diagram. Past about six apps, group them by owner inside the private network or draw each group of apps in its own diagram with the proxy as an external node.

Segmented cardholder data environment

Card payments pass a web application firewall and a DMZ, then a segmentation firewall into a small cardholder data environment that tokenises card numbers and keeps them in an encrypted vault, so the rest of the company only ever sees tokens.

When to use it. Start here when you take card payments and want the PCI DSS scope as small as it can be: card numbers enter one segment, are swapped for tokens at once, and nothing outside that segment stores them. It shows which networks are in scope, where the segmentation firewalls sit, and what feeds the SIEM. Start from the three-tier network pattern instead when no card data is involved.

Id and flavours. pci-cardholder-data-environment, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
customersCustomersWho pays by card on the internet.
dmzDMZThe name of the network that faces the internet and holds no card data at rest.
dmz-address10.10.0.0/24The address range of the DMZ, as a plain sample value.
checkoutCheckout appThe app that takes the order and the card form.
ordersOrders databaseWhere orders are kept, with a token in place of each card number.
cde-address10.50.0.0/24The address range of the cardholder data environment.
payment-servicePayment serviceThe one service that sends card details to the processor.
processorPayment processorThe acquirer or payment gateway outside your network.
corporateCorporate networkThe name of the network out of PCI scope, which never sees a card number.
back-officeBack officeThe staff and apps that read orders, such as support and finance.
siemSIEMThe security monitoring system that keeps and searches the logs.

Keep. Keep the web application firewall, both segmentation firewalls, the tokenisation service, the card vault, key management, file integrity monitoring, and the SIEM as fixed parts: an assessor looks for each of them. Keep the card number on one edge only, from the checkout app through the firewall, and let the corporate network reach the orders database and nothing in the cardholder data environment.

Rename. Rename the checkout app, the orders database, the payment service, the processor, the back office, and the networks and their address ranges through the slots. Pick the aws, azure, or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Draw the firewall rules between segments as a table, and the flow of one payment, with its authorisation and settlement, as a sequence diagram. When a hosted payment page or a third-party vault takes the card number instead, remove the tokenisation service and the vault and draw the provider as an external node.

Web application on a cloud

A single-page app is served through a CDN, backed by an API on a hosting plan, a database, a queue and worker, identity, storage, a delivery pipeline, and monitoring.

When to use it. Start here when the request is a typical web application and the reader needs to see every managed service around it: where files live, where code runs, how users sign in, how slow work is queued, and how changes ship. It is the usual first diagram of a cloud system.

Id and flavours. web-app-on-cloud, drawn below in its neutral flavour. It also comes in: Azure.

SlotDefaultWhat goes there
visitorsVisitorsWho uses the application.
visitors-subBrowsersA short second line for the visitors, such as the kind of client.
edgeEdgeThe name of the group in front of the application.
cdnContent deliveryThe content delivery network that serves files and forwards API calls.
sign-inSign-inThe name of the group that holds the identity service.
identityIdentity serviceThe service that signs users in and issues tokens.
storageStorageThe name of the group that holds the stored files.
siteWeb app filesThe files of the single-page app.
uploadsUploadsWhere files that users upload are kept.
planApplication planThe name of the hosting plan that runs the API.
apiOrders APIThe service the app calls; name it for what it does.
messagingMessagingThe name of the group that holds the queue.
queueJob queueThe queue the API puts slow work on.
workerBackground workerThe function that drains the queue.
databaseDatabaseWhere the application keeps its records.
deliveryDelivery pipelineThe name of the group that builds and deploys the API.
sourceSource codeWhere the code lives.
buildBuild pipelineThe step that builds and deploys the image.
monitoringMonitoringThe name of the group that watches the application.
telemetryMetrics and logsThe service that collects what the API reports.

Keep. Keep one group for each concern (edge, sign-in, storage, hosting plan, messaging, delivery, monitoring), the queue between the API and the worker as a dotted link, and the deploy link from the pipeline to the API. Keep direction=down.

Rename. Rename the services for what the application does, and the stack marks for its technologies (up to three on a node). Add a node to a group for a second service of the same kind, with an edge from the node that uses it.

Split. Past about 20 nodes, move the data stores and the queue into a second diagram that starts at the API, and keep only the API here. Draw the pipeline alone when it has more than three steps.

Three-tier web app behind a WAF

Users reach a web tier through DNS, a CDN, a web application firewall, and a load balancer, and an app tier behind it uses a primary database with a read replica, a cache, object storage, a secrets store, and monitoring.

When to use it. Start here for a classic web application where every request must pass a web application firewall before it reaches your servers, with separate web, app, and data tiers. It shows the order of the edge services and what the app tier depends on. Start from the three-tier network pattern instead when the subnets and the office connection matter more than the services.

Id and flavours. web-app-behind-waf, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
usersCustomersWho uses the web app.
domainshop.example.comThe domain users type, shown under the DNS node.
edgeEdgeThe name of the group in front of the network.
cdnContent deliveryThe CDN that caches pages and files close to users.
networkPrivate networkThe name of the network that holds the three tiers.
load-balancerLoad balancerThe load balancer that spreads requests over the web tier.
web-tierWeb tierThe name of the tier that renders pages.
webWeb serversThe servers or containers that render pages and call the app tier.
app-tierApp tierThe name of the tier that runs the business logic.
appOrder serviceThe application service; name it for what it does.
data-tierData tierThe name of the tier that holds the databases and the cache.
databasePrimary databaseThe database that takes every write.
replicaRead replicaThe copy of the database that serves reads.
cacheSession cacheThe cache for sessions and hot reads.
storageObject storageWhere uploads and generated files are kept.
secretsSecrets storeWhere the app tier reads database passwords and keys from.
monitoringMonitoringThe name of the group that collects metrics and logs from the app tier.

Keep. Keep the web application firewall between the CDN and the load balancer, so no request reaches the network without passing it; the firewall node has no slot for that reason. Keep the tiers in order, writes on the primary and reads on the replica, and the secrets store as the only place the app tier reads credentials from.

Rename. Rename the users, the domain, the services, and the stores through the slots, and name the app tier after what it does. Add a second app service as a node in the app tier with its own edges to the data it uses. Pick the aws, azure, or gcp flavour to draw that provider's edge, compute, and data services.

Split. Past about three services in the app tier, draw the edge and the web tier in one diagram and the app and data tiers in another. Draw the subnets and zones with the two-zone network pattern, and draw the delivery pipeline in its own diagram.

Serverless API

A client calls an API gateway that checks sign-in and routes to three functions, which keep records in a managed database and files in object storage.

When to use it. Start here when the request is a small HTTP API built from managed services with no servers to run: a gateway, short-lived functions, a managed database, and a bucket. It shows where sign-in is checked and where telemetry goes. Start from the three-tier network pattern instead when the services run on machines you manage.

Id and flavours. serverless-api, drawn below in its neutral flavour. It also comes in: AWS, Google Cloud.

SlotDefaultWhat goes there
clientClient appThe browser, mobile app, or program that calls the API.
client-subWeb or mobileA second line that says what kind of client it is.
gatewayOrders APIThe public name of the API that the gateway fronts.
path/ordersThe base path of the API, shown on the routes from the gateway.
sign-inSign-inThe name of the group that holds the identity service.
authUser directoryThe service that holds users and issues the tokens the gateway checks.
functionsFunctionsThe name of the group that holds the three request handlers.
fn-listList ordersThe function that returns many records.
fn-getGet orderThe function that returns one record.
fn-createCreate orderThe function that stores a new record and its file.
dataData storesThe name of the group that holds the database and the object storage.
databaseOrders databaseThe managed database that keeps the records.
storageOrder filesThe object storage that keeps uploaded files.
monitoringMonitoringThe name of the group that holds the telemetry service.
monitorLogs and metricsThe service that collects logs, metrics, and traces.

Keep. Keep the order of the groups (functions, sign-in, data stores, monitoring), the order of the functions (create, list, get), the sign-in check as the last edge from the gateway, the one dotted telemetry edge, which stands for every function, and direction=down. Keep the database and the storage in one group, because a group for each makes the arrows from the functions bunch at one point.

Rename. Rename the functions, the database, and the storage through the slots. Add a function by adding a node in the functions group, an edge from the gateway, and an edge to what it uses. Pick the aws or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Past about five functions, draw the functions as one node here and give each route group its own diagram. Draw a deployment pipeline in a second diagram.

Microservices behind an API gateway

Clients call one API gateway that checks identity and routes to small services, which talk to each other through a message bus and each keep their own database.

When to use it. Start here when the request is a system split into small services that own their data: one public entry point, a sign-in check, and events between services instead of shared tables. It shows who may be called from outside and who only reacts to events. Start from the serverless API pattern instead when the services are short-lived functions.

Id and flavours. microservices-gateway, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
clientsClient appsThe browsers, mobile apps, or programs that call the API.
clients-subWeb and mobileA second line that says what kind of client it is.
gatewayPublic APIThe public name of the API that the gateway fronts.
catalog-path/catalogThe path the gateway routes to the catalog service.
booking-path/bookingsThe path the gateway routes to the booking service.
sign-inSign-inThe name of the group that holds the identity provider.
identityIdentity providerThe service that holds users and issues the tokens the gateway checks.
public-servicesPublic servicesThe name of the group of services the gateway exposes.
catalogCatalog serviceThe service that answers read requests for the things you offer.
bookingBooking serviceThe service that accepts requests and publishes an event for each one.
messagingMessagingThe name of the group that holds the message bus.
busMessage busThe topic or bus that carries events from one service to the others.
eventbooking createdThe event the booking service publishes and the billing service reads.
internal-servicesInternal servicesThe name of the group of services that no client calls directly.
billingBilling serviceThe service that reacts to events and has no public route.
catalog-databaseCatalog databaseThe database that only the catalog service reads and writes.
booking-databaseBooking databaseThe database that only the booking service reads and writes.
billing-databaseBilling databaseThe database that only the billing service reads and writes.

Keep. Keep one database for each service and no edge from a service to another service's database, because that is what the pattern says. Keep the dotted edges through the message bus, the public and internal groups, the identity check as an edge from the gateway only, and direction=down.

Rename. Rename the services, the databases, the routes, and the event through the slots. Add a public service by adding a node in the public group, an edge from the gateway, and a database with an edge from the service. Pick the aws, azure, or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Past about five services, draw the gateway and the public services in one diagram and give each group of related services its own, with the bus shown as an external node. Draw tracing, deployment, and the service mesh in separate diagrams.

Container platform

A delivery pipeline pushes images to a registry, and a managed cluster runs three services on a redundant node pool behind an ingress, with configuration, secrets, and monitoring.

When to use it. Start here when the request is a Kubernetes or managed container platform: where images come from, how traffic reaches the services, and what the services depend on. It does not show networks, multiple environments, or the data stores the services use.

Id and flavours. container-platform, drawn below in its neutral flavour. It also comes in: Google Cloud.

SlotDefaultWhat goes there
usersUsersWho sends traffic to the platform from outside.
pipelineDelivery pipelineThe name of the group that builds and publishes images.
repositorySource repositoryWhere the application code lives.
buildBuild and testThe pipeline stage that builds an image and runs its tests.
registryImage registryThe store that holds the built container images.
clusterManaged clusterThe name of the container cluster that runs the services.
cluster-detailManaged control planeA short fact about the cluster, such as who runs its control plane or its size.
ingressIngressThe entry point that routes outside traffic to the services.
node-poolNode poolThe name of the redundant set of machines the services run on.
webWeb serviceThe first service behind the ingress, for example the user interface.
apiAPI serviceThe middle service, which reads configuration and secrets.
adminAdmin serviceThe third service behind the ingress.
configConfigurationThe settings the services read when they start.
secretsSecretsThe credentials and keys the services read.
observabilityMonitoringThe name of the group that watches the cluster.
monitorMonitoring serviceThe service that collects metrics and raises alerts.

Keep. Keep the order from pipeline to registry to cluster to monitoring, the three services as the members of the node pool overlay, and direction=down. Keep a label on both the push edge and the traffic edge, or on neither, so the registry stays level with the first service. Keep the dotted edges: the image pull and the metrics are asynchronous.

Rename. Rename the services, the cluster, and the pipeline stages through the slots. Add a service by adding a node, an edge from the ingress, and its id in the overlay members. The pull and metrics edges each stand for every service. Swap the generic icons for a provider's with the flavour you pick.

Split. Past about five services, draw the cluster alone and show one service of it here. Draw the data stores, the network, and each environment in their own diagrams.

Queue and worker pool

A web API puts jobs on a queue, a pool of workers takes them and writes results to a database, failed jobs go to a dead-letter queue, and an alarm watches the queue depth.

When to use it. Start here when the request is background work: a request is accepted quickly and the slow part runs later on workers that can scale out. It shows the hand-off through a queue, the redundant pool, the retry path, and the alarm that tells you the workers fall behind. Start from the event-driven pipeline pattern instead when many independent consumers react to the same event.

Id and flavours. queue-worker, drawn below in its neutral flavour. It also comes in: AWS.

SlotDefaultWhat goes there
clientClient appThe browser, mobile app, or program that submits work.
submitPOST /jobsThe request the client sends to submit a job.
apiWeb APIThe service that accepts a request and enqueues a job.
messagingMessagingThe name of the group that holds the job queue.
queueJob queueThe queue that holds jobs until a worker takes one.
poolWorkersThe name of the redundant set of workers. Keep it short, about eight characters, so its tab stays clear of the first arrow.
workerWorkerWhat a worker is called; a number follows it.
dataResultsThe name of the group that holds the database.
databaseResults databaseThe database that keeps what the workers produce.
dlqDead-letter queueThe queue that keeps jobs that failed after every retry.
retries3How many tries a job gets before it moves to the dead-letter queue, as a number.
alarmQueue depth alarmThe alarm that fires when too many jobs wait in the queue.

Keep. Keep the overlay around the workers, and the one edge from the pool to the database and the one to the dead-letter queue, because each stands for every worker. Keep the edge from the queue to the alarm without a label, because a label pushes the alarm one row below the pool. Keep the pool name short, because a long name makes a tab wide enough to cover the first arrow. Keep direction=down.

Rename. Rename the services, the queue, and the stores through the slots, and set the retry count in the retries slot. Change the number of workers by adding a node, a dotted edge from the queue, and the member id in the overlay, in all three places. Pick the aws flavour to swap the generic glyphs for AWS icons.

Split. Past about five workers, keep three nodes and say how many more in the pool name. Draw the scaling rules and what the alarm triggers, such as paging or adding workers, in a second diagram.

Event-driven pipeline

Several services publish events to an event bus, three independent consumers react to them, and events that keep failing go to a dead-letter queue.

When to use it. Start here when the request is publish and subscribe: services that emit events without knowing who listens, and consumers that work on their own. It shows the fan-out from one bus, the asynchronous links, and where failed events end up. Start from the queue and worker pattern instead when one service hands a job to a pool of workers.

Id and flavours. event-driven-pipeline, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
producersProducersThe name of the group that holds the services that publish events.
producer-1Orders serviceThe first service that publishes events.
producer-2Payments serviceThe second service that publishes events.
producer-3Inventory serviceThe third service that publishes events.
messagingMessagingThe name of the group that holds the event bus.
busEvent busThe topic or bus that receives every event and hands it to each consumer.
dlqDead-letter queueThe queue that keeps events a consumer could not handle after its retries.
consumersConsumersThe name of the group that holds the independent consumers.
archiverArchive filterThe consumer that keeps only matching events and archives them.
processorEvent processorThe consumer that transforms every event and stores the result.
notifierNotifierThe consumer that turns some events into notifications.
dataData storesThe name of the group that holds the archive and the database.
archiveEvent archiveThe object storage that keeps archived events.
databaseEvents databaseThe database that keeps processed events.
externalThird partyThe name of the group for the service you call but do not run.
emailEmail providerThe outside service that delivers the notifications.

Keep. Keep the dotted arrows from the producers to the bus and from the bus to each consumer, because they say the links are asynchronous, and keep the edge from the bus to the dead-letter queue. Keep the second line of the bus node about as long as it is, because a narrow node makes the three arrows into it bunch at one point.

Rename. Rename the services, the consumers, and the stores through the slots. Add a consumer by adding a node in the consumers group, a dotted edge from the bus, and an edge to what it writes. Pick the aws, azure, or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Past four producers or four consumers, draw the producers as one node and give each consumer its own diagram, or split by event type. Draw how dead letters are inspected and replayed in a second diagram.

Static site behind a CDN

Visitors resolve a name through DNS and reach a content delivery network with a certificate, which serves files from a storage bucket that a build pipeline updates and clears from the cache.

When to use it. Start here when the request is a static website, a documentation site, or a single-page app served from object storage through a CDN. It shows the name lookup, the HTTPS certificate, the origin, and how new files reach visitors. It does not show dynamic back ends or APIs behind the site.

Id and flavours. static-site-cdn, drawn below in its neutral flavour. It also comes in: AWS.

SlotDefaultWhat goes there
visitorsVisitorsWho opens the site: browsers, readers, or customers.
edgePublic edgeThe name of the group that faces visitors.
dnsDNS zoneThe service that turns the site name into the address of the delivery network.
certTLS certificateThe certificate that lets the delivery network answer over HTTPS.
cdnContent delivery networkThe cache that serves the files from locations near visitors.
originOriginThe name of the group that holds the source of the files.
bucketSite bucketThe object storage that holds the built site.
bucket-detailStatic filesA short second line for the bucket, such as what it holds.
pipelinePublishing pipelineThe name of the group that builds and publishes the site.
repositorySource repositoryWhere the site source lives.
buildBuild siteThe step that turns the source into static files.
publishPublish filesThe step that uploads the files and clears the cache.
publish-detailThen clears the cacheA short second line that says what happens after the upload.

Keep. Keep the visitor path as the right column and the pipeline as the left column, the dotted edge from the publish step to the delivery network, and direction=down. Keep one label on each of the two chains that lead to the middle row, so the publish step stays level with the delivery network.

Rename. Rename the services, the bucket, and the pipeline steps through the slots. Add a step to the pipeline by adding a node and an edge before the publish step, and label no more than one edge in the chain. Swap the generic icons for a provider's with the flavour you pick.

Split. Add an API or a function behind the delivery network in a second diagram, and keep this one for the static path. Draw several sites, regions, or environments one per diagram, and show the extra origin here only when it changes how visitors are served.

Data lake and analytics

Sources feed an ingestion stage into a raw zone, a processing stage cleans the data into a curated zone, and a warehouse serves analysts through dashboards, with a catalog that describes the datasets.

When to use it. Start here when the request is a data platform: where data comes from, how it is landed and cleaned, and how people query it. It shows the raw and curated zones as separate stores. It does not show orchestration, access control, or machine learning workloads.

Id and flavours. data-lake-analytics, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
sourcesData sourcesThe name of the group that holds everything the data comes from.
app-dbApplication databaseThe operational database that the business applications write to.
eventsEvent streamsThe continuous feeds of events, such as clicks, sensor readings, or messages.
filesFile dropsFiles that partners or other teams deliver on a schedule.
ingestIngestionThe stage that reads every source and lands the data unchanged.
lakeData lakeThe name of the group that holds the storage zones and the processing between them.
raw-zoneRaw zoneThe name of the zone that keeps the data exactly as it arrived.
raw-detailData as receivedA short line under the raw zone name that says what the zone guarantees.
raw-storeRaw filesThe storage that holds the raw data.
processClean and transformThe stage that validates, cleans, and reshapes the raw data.
curated-zoneCurated zoneThe name of the zone that holds trusted, ready-to-use data.
curated-detailCleaned and typedA short line under the curated zone name that says what the zone guarantees.
curated-storeCurated tablesThe storage that holds the curated data.
warehouseWarehouseThe analytical database that answers queries over the curated data.
dashboardsDashboardsThe reports and charts that analysts open.
analystsAnalystsThe people who read the data and ask questions of it.
catalogData catalogThe register that describes each dataset: its owner, its meaning, and its schema.

Keep. Keep the single column from ingestion to analysts, the two zones as groups inside the data lake group, and direction=down. Keep the catalog as a leaf with one dotted edge from the curated store, because an edge into the raw zone pulls the whole column out of line.

Rename. Rename the sources, the stages, the zones, and the stores through the slots. Add a source by adding a node in the sources group and an edge to the ingestion stage. Swap the generic icons for a provider's with the flavour you pick.

Split. Past about five sources, group them by kind and show one node per kind. Draw orchestration, access control, and streaming paths in their own diagrams, and add a third zone only if the picture stays one column.

Retrieval-augmented AI application

An app sends prompts through an AI gateway and input guardrails to a retrieval service, which adds the nearest chunks from a vector store before a managed model answers, with output guardrails on the answer and an audit log of every prompt and answer.

When to use it. Start here when an assistant or search box must answer from your own documents with a language model, and security asks where prompts go, what checks them, and what is kept. It shows that every model call passes the gateway and both guardrails, and that a separate ingestion path fills the vector store. Start from the event-driven pipeline pattern instead when the model runs in a batch job with no person waiting.

Id and flavours. ai-rag-application, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
usersEmployeesWho asks the questions.
appAssistant appThe chat or search app people use.
retrievalRetrieval serviceThe service that turns a question into a search and picks the chunks to send.
vector-storeVector storeWhere the embedded chunks are kept and searched by similarity.
modelLanguage modelThe managed model endpoint that writes the answer.
knowledgeKnowledge baseThe name of the group that holds the documents, their ingestion, and the search over them.
sourcesPolicies and manualsThe documents the answers are drawn from.

Keep. Keep the AI gateway as the only way from the app to the model, the input guardrails before retrieval, the output guardrails after the model, and the dotted line from the gateway to the audit log. The gateway, both guardrails, the chunk and embed step, and the audit log are fixed parts, because they are the controls a security review asks to see.

Rename. Rename the people, the app, the retrieval service, the vector store, the model, and the source documents through the slots. Add a second model by adding a node in the model access group and an edge from the gateway, since the gateway routes between them. Pick the aws, azure, or gcp flavour to swap the generic glyphs for that provider's icons.

Split. Draw the ingestion job on its own, with each source, its schedule, and how deletions reach the vector store, when it has more than two steps. Draw tool calls or agents that act on other systems in a second diagram, since they need their own permissions and checks.

Multi-region failover

A global routing service sends users to a primary region and fails over to a standby region, which holds replicated data and an identical stack.

When to use it. Start here when the request is to survive the loss of a whole region: it shows which region serves normally, what switches, and what is copied. Use it to discuss recovery time, because the replication links are the part that decides how much data a failover loses.

Id and flavours. multi-region-failover, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
usersUsersWho uses the application.
routingGlobal routingThe service that chooses a region by health, such as DNS routing or a global load balancer.
routing-subHealth-checkedA short second line for the routing service.
primaryPrimary regionThe name of the region that serves traffic normally.
primary-subActiveA short second line for the primary region.
standbyStandby regionThe name of the region that takes over.
standby-subPassiveA short second line for the standby region.
balancerLoad balancerThe balancer in front of the servers of each region.
serversApplication serversThe servers of each region.
databasePrimary databaseThe database in the primary region, which takes the writes.
replicaReplica databaseThe database in the standby region, which follows the primary.
replicationreplicationWhat the dotted link between the two databases carries.

Keep. Keep both regions with the same three nodes in the same order, the dashed failover link beside the solid normal link, and the dotted replication link between the two databases, which stay side by side.

Rename. Rename the regions and the services through the slots. Keep one replicated pair in view: a second pair draws its link across the first, so put it in a second diagram.

Split. Past about five nodes in a region, draw one region alone in its own diagram and keep a single node per region here. Draw the failover procedure as a sequence diagram instead.

Monitoring and observability stack

Applications and hosts send metrics, logs, and traces through one OpenTelemetry collector to a store for each signal, which dashboards read and alert rules watch to page the on-call engineer.

When to use it. Start here to show how telemetry leaves a system and reaches the people who act on it: one collector, a store for each signal, dashboards, and the path from an alert rule to a page. It suits a platform team writing down the monitoring every service must join. Draw the services themselves in a separate diagram, such as the microservices or container platform pattern.

Id and flavours. observability-stack, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
workloadsWorkloadsThe name of the group that holds what is being watched.
appCheckout serviceThe application that sends telemetry; name it for what it does.
hostsHost fleetThe machines or nodes whose agents send host metrics and logs.
pipelineTelemetry pipelineThe name of the group that holds the collector.
collectorOpenTelemetry collectorThe collector every signal passes through, where sampling and redaction happen.
storesSignal storesThe name of the group that holds the three stores.
metricsMetrics storeWhere time series are kept.
logsLog storeWhere log lines are kept and searched.
tracesTrace storeWhere spans are kept and joined into traces.
insightInsightThe name of the group that holds the dashboards and the alert rules.
dashboardsDashboardsWhere people look at the signals.
alertsAlert rulesThe rules that decide when a person must act.
pagingIncident toolThe on-call and incident tool that pages people, such as a paging service.
on-callOn-call engineerWho is paged when a rule fires: a person or a rota.

Keep. Keep the collector as the only way into the stores, because that is where sampling, redaction of personal data, and routing are decided once for every team. Keep one store for each signal, the alert rules reading the metrics store rather than the applications, and the edge from the alert rules to the incident tool, so every alert that fires reaches a person.

Rename. Rename the application, the hosts, the stores, and the incident tool through the slots, and name the on-call rota that owns the alerts. Add a second application as a node in the workloads group with its own edge to the collector. Pick the aws, azure, or gcp flavour to draw that provider's managed services.

Split. Past about four workloads, draw them as one node per team and give each team its own diagram of what it sends. Draw the incident process, with its escalation steps and status page, in a separate diagram, and draw collectors per region in a second diagram when telemetry stays inside each region.

Internal developer platform

Developers create a service from a golden-path template in a portal, and its code and infrastructure reach development, staging, and production clusters through continuous integration and policy checks, with shared secrets, observability, and cost reporting.

When to use it. Start here when a platform team describes the paved road it offers product teams: where a new service starts, how code and infrastructure reach each environment, and which services every environment shares. It shows the checks no team may skip. Start from the CI/CD pipeline or GitOps pattern instead when the diagram is about one release flow.

Id and flavours. internal-developer-platform, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
developersProduct teamsThe developers who use the platform.
portal-groupDeveloper portalThe name of the group that holds the portal and its templates.
portalService catalogThe portal page that lists every service and its owner.
templateGolden-path templateThe template a new service starts from, such as a web service or a worker.
repoService repositoryThe repository the template creates, holding the code and its infrastructure.
deliveryCode deliveryThe name of the group that builds and stores the code.
ciContinuous integrationThe pipeline that builds and tests each change.
registryArtifact registryWhere built images and packages are kept.
infrastructureInfrastructure deliveryThe name of the group that plans and applies infrastructure.
iacInfrastructure as codeThe step that plans the infrastructure the repository describes.
environmentsEnvironmentsThe name of the group that holds the clusters.
devDevelopment clusterThe cluster where every merged change runs first.
stagingStaging clusterThe cluster that mirrors production for final checks.
productionProduction clusterThe cluster customers use.
sharedShared platform servicesThe name of the group of services every environment uses.
secretsSecrets storeWhere every environment reads its credentials from.
observabilityObservabilityWhere every environment sends its metrics, logs, and traces.
costCost reportingThe report of spend for each team and service.

Keep. Keep the policy checks between the infrastructure plan and every apply; the node has no slot because no team renames or removes it. Keep the template as the only way a new repository starts, the separate paths for code and for infrastructure, the promotion order from development to staging to production, and one shared secrets store.

Rename. Rename the teams, the template, the clusters, and the platform services through the slots, and name the template after what it builds, such as a web service. Add a second template as a step next to the first with its own edge to the repository. Pick the aws, azure, or gcp flavour to draw that provider's services.

Split. Past about three environments or a second kind of runtime, draw the portal and templates in one diagram and the path to the environments in another. Draw how one release moves through the clusters with the GitOps pattern, and draw the observability services with the observability stack pattern.

CI/CD delivery pipeline with an approval gate

A commit is built, tested, scanned, and stored as an image, then deployed to staging, held for an approval, and released to production.

When to use it. Start here for a continuous integration and delivery flow with a manual gate before production. It shows which steps belong to the pipeline, which environments hold running code, and where people are notified. Draw a different diagram for a pipeline that releases straight to production or for one with many parallel jobs.

Id and flavours. ci-cd-delivery-pipeline, drawn below in its neutral flavour. It also comes in: Azure.

SlotDefaultWhat goes there
pipelineDelivery pipelineThe name of the pipeline that builds and checks the code.
sourceSource repositoryWhere the code lives and where a change starts.
source-noteCommit to the main branchA short second line for the repository: what starts the pipeline.
buildBuildThe step that compiles the code and packages it.
build-noteCompile and packageA short second line for the build step.
testTestThe step that runs the automated tests.
test-noteUnit and integrationA short second line for the test step.
scanSecurity scanThe step that checks the code and its dependencies for known problems.
scan-noteCode and dependenciesA short second line for the scan step.
registryImage registryWhere the built image is stored and versioned.
registry-noteVersioned imagesA short second line for the registry.
alertsSecurity channelWho hears about scan findings: a chat channel or a mailing list.
stagingStagingThe name of the pre-production environment.
deploy-stagingDeploy to stagingThe step that puts the image on the staging environment.
staging-appStaging appThe application as it runs in staging.
approvalRelease approvalThe manual gate between staging and production.
approval-noteA reviewer signs offA short second line for the approval: who decides.
reviewersRelease channelWho is asked to approve: a chat channel or a mailing list.
productionProductionThe name of the live environment.
deploy-productionDeploy to productionThe step that puts the approved image on production.
production-appProduction appThe application as it runs in production.

Keep. Keep the order of the steps, the group around the pipeline steps, one group for each environment, and the approval node outside both environments. Keep the dotted arrows for notifications, because they mark a message that nothing waits for.

Rename. Rename the steps, environments, and channels through the slots. Add a step such as a lint or a performance test by adding a node and an edge between its neighbours, inside the pipeline group. Add an environment by copying the staging group and its two edges.

Split. Past about four steps in the pipeline or a third environment, draw the pipeline alone in one diagram and the environments with their rollout in another. Draw rollback and failure paths in a second diagram.

GitOps delivery to clusters

A pipeline builds, tests, and scans an image and writes its tag to a config repository, and a GitOps controller syncs the development, staging, and production clusters from it, with a promotion and an approval on the way.

When to use it. Start here when releases reach Kubernetes by changing a config repository that a controller pulls from, rather than by a pipeline that pushes to the clusters. It shows where each check happens and that only an approved change reaches production. Start from the CI/CD pipeline pattern instead when the pipeline deploys to each environment itself.

Id and flavours. gitops-kubernetes-delivery, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
app-repoApplication repositoryThe repository that holds the service code.
pipelineCI pipelineThe name of the group of steps that check every change.
buildBuildThe step that builds the container image.
testTestThe step that runs the automated tests.
scanImage scanThe step that checks the image and its dependencies for known problems.
registryContainer registryWhere the scanned images are kept.
config-repoConfig repositoryThe repository that holds the desired state of every environment.
controllerGitOps controllerThe controller that makes each cluster match the config repository.
dev-envDevelopmentThe name of the first environment.
devDevelopment clusterThe cluster every merged change reaches first.
staging-envStagingThe name of the pre-production environment.
stagingStaging clusterThe cluster that mirrors production for final checks.
approversRelease owners sign offWho gives the approval before production, as a short second line.
production-envProductionThe name of the live environment.
productionProduction clusterThe cluster customers use.

Keep. Keep the image scan before the registry, the config repository as the only input of the controller, and no edge from the pipeline to a cluster, because in GitOps the clusters pull. Keep the promotion pull request and the approval before production as fixed nodes; only the second line that names the approvers is a slot.

Rename. Rename the repositories, the steps, the environments, and the clusters through the slots, and name the approvers. Add an environment by copying a cluster group with a promotion step in front of it. Pick the aws, azure, or gcp flavour to draw that provider's registry, scanner, and clusters.

Split. Past about three environments or more than one cluster in each, draw one diagram for the pipeline and the config repository and another for the clusters and how the controller reaches them. Draw rollback, drift alerts, and secrets in separate diagrams.

Sign-in with an authorization code and proof key

A browser app signs a person in through an identity provider with the authorization code flow and a proof key, calls a backend API with the access token, and refreshes it when it expires.

When to use it. Start here for the sign-in of a single-page or mobile app that has no client secret and calls its own backend API. It shows where the proof key is made and checked, what the API verifies, and how an expired token turns into a refresh and a retry. Draw a different diagram for a server-rendered app that keeps a client secret, or for machine-to-machine access with no person.

Id and flavours. sign-in-token-flow, drawn below in its neutral flavour. It has no provider flavour.

SlotDefaultWhat goes there
personPersonWho signs in.
person-noteAt the browserA short second line for the person.
identity-providerIdentity providerThe service that signs the person in and issues tokens.
identity-provider-noteIssues the tokensA short second line for the identity provider.
appBrowser appThe app that has no client secret and starts the sign-in.
app-notePublic clientA short second line for the app.
apiBackend APIThe service that accepts the access token and returns data.
api-noteChecks every tokenA short second line for the API.
api-dataDataWhat the API returns when the token is accepted.

Keep. Keep the order of the messages: the verifier and challenge are made before the redirect, the code travels back by redirect, and only the exchange carries the verifier. Keep the alt block, because the expired branch is the part readers look for, and keep the retry after the refresh.

Rename. Rename the four participants, their second lines, and the data the API returns through the slots. To add a scope or an audience, change the message text by hand. Add a second API as a fifth participant to the right of the first, with its own request and response.

Split. Draw sign-out, a revoked refresh token, and a first sign-in with consent as separate diagrams. Past five participants, draw the backend services on their own in a second diagram and keep one participant for them here.

Single sign-on and SCIM provisioning

A customer's identity provider signs people in to a SaaS app with SAML or OIDC and creates, updates, and deactivates their accounts over SCIM, while the app maps groups to roles and audits every change.

When to use it. Start here when a SaaS app lets each customer bring its own identity provider: sign-in goes through the customer's directory, and accounts follow its joiners, movers, and leavers without anyone editing them by hand. It shows the two separate paths, sign-in and provisioning, and that both end in the audit log. Start from the sign-in token flow pattern instead when the question is the order of the redirects and tokens in one sign-in.

Id and flavours. sso-scim-integration, drawn below in its neutral flavour. It also comes in: AWS, Azure, Google Cloud.

SlotDefaultWhat goes there
customerCustomer organisationThe name of the group that holds the customer's people and identity provider.
usersEmployeesWho signs in to the app through their own identity provider.
hr-systemHR systemThe source of truth for who joins, moves, and leaves.
identityIdentity providerThe customer's directory, which holds the people and groups and issues sign-ins.
identity-subUsers and groupsA second line that says what the identity provider holds.
saasSaaS appThe name of the group that holds your app and the endpoints it exposes.
appWeb appThe app people use once they are signed in.
rolesAdmin, member, viewerThe roles the app gives, which each identity provider group maps to.
accountsAccounts and rolesWhere the app keeps its accounts, their roles, and whether each is active.

Keep. Keep sign-in and provisioning as two separate edges from the identity provider, the group to role mapping between the SCIM endpoint and the accounts, and the dotted lines from both endpoints to the audit log. The sign-in endpoint, the SCIM endpoint, the mapping, and the audit log are fixed parts, because a customer's security review asks for each of them by name.

Rename. Rename the customer, its people, its HR system and identity provider, your app, its roles, and where it keeps accounts through the slots. Pick the aws, azure, or gcp flavour to draw your side with that provider's icons.

Split. Draw the order of one sign-in, with its redirects and assertion checks, as a sequence diagram of its own. When several customers connect, draw one customer here and list the others in a table, since each has the same shape.

Multi-tenant application schema

Organizations own projects and an audit log, and users join organizations through a memberships table that carries a role.

When to use it. Start here for a software-as-a-service product where several customers share one database and every row belongs to an organization. It shows the join table for a many-to-many link with a role, the foreign key that scopes each row to its tenant, and an append-only log. Draw a different schema when each customer has its own database or when users belong to no organization.

Id and flavours. database-schema-starter, drawn below in its neutral flavour. It has no provider flavour.

SlotDefaultWhat goes there
organizationsOrganizationsThe label of the tenant table: the customer, team, or account that owns data.
organizations-noteThe tenant that owns dataA short second line for the tenant table.
usersUsersThe label of the table of people who sign in.
users-notePeople who sign inA short second line for the users table.
membershipsMembershipsThe label of the join table between users and tenants.
memberships-noteJoins users to organizationsA short second line for the join table; say what the role controls.
projectsProjectsThe label of the main business table that belongs to a tenant, such as projects, workspaces, or sites.
projects-noteWork owned by one organizationA short second line for that business table.
audit-logAudit logThe label of the append-only table that records who did what.
audit-log-noteAppend-only record of changesA short second line for the audit table.

Keep. Keep the organization_id foreign key on every table that holds tenant data, the pair of foreign keys in the join table, and the nullable flags on columns that are empty for a good reason. Keep the audit table append-only, and keep actor_id without a foreign key so the history survives when a user is deleted.

Rename. Rename the tables and their second lines through the slots. To rename a column, change it in the source by hand, in the table and in every relation that names it. Add business tables the same way projects is drawn: an id, an organization_id foreign key, and a relation to organizations.

Split. Past six tables, draw each area on its own: tenancy and access in one diagram, the business tables in another, and billing in a third. Keep organizations in each one so the foreign keys still have a parent.

5. Adapting a pattern

DoDo not
Rename through slots first, then edit the source for what slots cannot changeRewrite the source from scratch and lose the checked groups and icons
Keep the group tree: cloud, network, zones, tiers, and subnets carry the meaningFlatten groups to save space, or colour them by hand
Keep a replicated pair, such as a primary and a replica, as one pair in a diagramAdd a second replicated pair in the same diagram; draw a second diagram instead
Split a pattern at the line its Split note namesRaise the node count by shrinking text
Give every node the icon of its product, found with search_iconsInvent an icon name; validate_diagram rejects it with the nearest valid one
Run validate_diagram after every edit and fix each warningIgnore a warning because the picture looks fine

A pattern is a starting point, not a template to fill in blindly. If the request names a service that the pattern has no node for, add a node for it with its own icon. If the pattern has a node that the request does not mention, remove it.

6. Your organisation's own patterns

On Enterprise, an organisation's owner or admins can save diagrams in this same format on its Patterns tab, with an id such as org:payments-service. Agents connected to the organisation find them first with find_pattern, and only them when the owner turns on Agents start from approved patterns. See Retention, legal hold and approved patterns.

See also

DocWhy
Cloud architectureGroup types, provider icons, and the icon pages behind every pattern
Retention, legal hold and approved patternsSave your organisation's own patterns, and ask its agents to start from them
Writing diagrams with an agentThe validate-and-fix loop an agent follows
Writing diagramsThe whole language, kind by kind
Tool referencefind_pattern, get_pattern, draw_from_pattern, and the other tools
Language referenceEvery group type, overlay option, arrow, and diagnostic code