Skip to content

Modeling guidelines

Modeling guidelines are the judgment calls the reference can’t make: what to write when the Model accepts several answers. The Authoring guide for agents gives coding agents the same rules, so people and agents model the same way.

payments/model.yaml
systems:
payments:
name: Payments
description: Moves money between accounts and banks.
services:
payments-service:
name: Payments Service
description: Validates, posts and settles customer payments.
technology: Java, Spring Boot
relationships:
- to: payments-db
description: Stores payment state in
technology: JDBC
- to: core:mainframe
description: Posts payments to the ledger in
technology: XML/HTTPS
- to: card-gateway
description: Settles card payments through
technology: ISO 8583
payments-db:
name: Payments DB
type: datastore
technology: PostgreSQL (Amazon RDS)
fraud-detection:
name: Fraud Detection
description: Scores each payment for fraud and holds suspicious ones.
technology: Python
relationships:
- to: payments-service
description: Scores each initiated payment
interaction: async
via: platform:kafka
channel: payments.initiated
card-network:
name: Card Network
description: The card scheme the bank settles card payments with.
external: true
services:
card-gateway:
name: Card Scheme Gateway
external: true
technology: ISO 8583 over TCP

Big Bank’s Payments Project, above, shows most of them: a System with its Services, a datastore, and an External card scheme.

Model what someone outside the Team needs to know. Start with Services, the deployable units, and the Relationships between them. That is enough for every impact question, every URL and every Owner.

  • A Service is a deployable unit of software, the thing with a URL. Databases and message brokers are Services too, with type: datastore or type: broker, because other Services depend on them.
  • A Component, a part inside a Service, is worth adding when the Team talks about it by name. Add Components when people outside the Team ask which part of a Service does something. Leave out classes, packages and modules that only the code knows about.
  • A Relationship is declared at the level you know. If the code shows which Component calls which, declare it between Components. Otherwise declare it between Services. Relationships between Systems are derived from these, never declared.

Detail can be added later without breaking anything. Adding Components to a Service changes no id and no Relationship.

  • A Service runs. If it is deployed on its own and has a URL or an address, it is a Service.
  • A System groups. A System is a named group of Services that together deliver one business capability, such as Payments. It isn’t deployed and has no URL.
  • Not every Service needs a System. A Service that serves everyone, such as a shared message broker, can stand on its own.
  • The grouping comes from people, not code. Code shows what runs and what it calls. Which System a Service belongs to is a business decision, so ask the Team.

Systems don’t nest, and a Service sits in at most one System. If a group of Systems feels like it needs a parent, tag them instead.

An External System or Service runs outside your organization, such as a payment provider, a card scheme or an email API.

  • Outside the organization only. A Service another Team runs isn’t External. It belongs in that Team’s Project, and you point to it with its Qualified id, such as core:mainframe.
  • Declared by the Team that integrates with it. If no Project has it yet, declare it in your own Project, owned by your Team. Your Team is the one accountable for the integration.
  • An External Service has no Components. You can’t see inside it, so don’t model its insides.
  • Another Team’s Service that isn’t in the Model is a gap, not an External. Leave the Relationship out and tell that Team, so they declare their own Service.

An id is how everything else refers to an Element: Relationships, Deployments, Views, ADRs and other Teams’ Projects. The name is only what people read. Pick ids that stay true when the name changes.

  • Name what it does. payments-service and fraud-detection stay true longer than a product name, a code name or a vendor.
  • Leave out what changes. Keep the Team, the version and the technology out of an Element’s id. orders-db survives a move from one database to another. orders-postgres-v2 doesn’t.
  • Lowercase slugs. An id is lowercase letters, digits and hyphens, unique in its Project across Elements and Deployment Targets.
  • Short is fine inside a Project. Ids are namespaced by Project, so api in one Project doesn’t clash with api in another.

Changing a name is a one-line edit. Changing an id means adding the new one, repointing everything that refers to it and removing the old one. See Rename, move or remove.

A Project is one Team’s slice of the Workspace, and its owner is the default Owner of everything in it.

  • One Project per Team is the usual shape. A Team that owns two Systems can keep both in one Project.
  • Split when a second Team owns most of it. Setting owner on a few Elements is fine. When most of a Project belongs to another Team, give that Team a Project of its own.
  • Don’t split for size. A Project can hold any number of files, in any folders. Split a large Project into files, not into Projects.
  • Split early. Moving an Element to another Project changes its Qualified id, so every reference from other Projects has to change too.

A Deployment Target is where Services run, such as a region or a cluster. Declare each one once, in the Project of the Team that runs it.

  • A platform Team declares the shared ones. In Big Bank, the Platform Project declares the cloud region and its clusters. Every other Project deploys onto them by Qualified id, such as platform:eks-prod.
  • A Target can have its own Owner. Big Bank’s Platform Project also declares the London data center, owned by the Core Banking Team that runs it.
  • Don’t copy a Target into your Project. Two copies of one cluster split its Deployments in two, and the Deployment View shows two clusters.

The viewer already has a Generated View for every scope: the System landscape, the Service landscape, each System’s Services, each Service’s Components, and each Environment’s Deployments. Most questions are answered there, with a Lens, and shared as a link.

Write a Saved View when:

  • The question comes back. “What does a mainframe outage take down?” gets asked in every incident. A Saved View gives it a name and a stable link.
  • It has an audience. Know who the View is for and what it answers. That sets its level and what it includes.
  • No Generated View shows it at a glance. A View that only repeats a Generated View is one more thing to keep up to date.
  • It is a scenario. A Dynamic View, the ordered Steps of one scenario, is always a Saved View.

For a one-off question, share the viewer’s link instead.

  • The Model is for people outside the Team. The Team already knows its own code. Modeling past what others need adds files to maintain and no answers.
  • People and agents follow the same guidelines. The Authoring guide for agents gives coding agents these rules, and an agent asks for what code can’t tell it: the System grouping, External flags, descriptions and Owners. A Model edited by both reads as if one hand wrote it.
  • Ids are references. Everything in a Workspace points at ids, across files and across Teams. An id that survives a rename keeps those references from breaking.
  • Each thing is declared once. A Service, a shared cluster or an External provider has one declaration and one Owner. Copies would drift apart, as hand-drawn diagrams do.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.