Relationships
Topic relationships: archidocs guide relationships or get_guide("authoring", "relationships").
A Relationship is declared under its consumer and points to the provider it depends on. Declare it at the level you know: Component to Component if the code shows which part calls which, else Service to Service. Edges between higher-level Elements are derived from these.
Write one
Section titled “Write one”upsert_relationship(project, from, to, fields?, id?):
fromis the consumer, in this Project.tois a bare id in this Project orproject:idin another; resolve it withsearch_elements.fields:description(what the consumer uses the provider for, as a verb phrase: “Reads prices from”),technology(“HTTPS/JSON”, “gRPC”, “SQL”),interaction(syncby default, orasync),tags,via,channel.idis needed only to tell apart several Relationships on the same pair; with noidand several on the pair, the tool returnsambiguouswith each candidate’s file:line.
Constraints
Section titled “Constraints”- A Person is only ever a consumer.
- An Element can’t depend on itself, its ancestor or its descendant.
viaandchannelare forasynconly.
Async through a broker
Section titled “Async through a broker”An event Relationship runs through a broker Service (type: broker). The Subscriber declares it, pointing to the Publisher, with interaction: async, via the broker, and channel the topic or queue:
services: emails: name: Emails relationships: - to: orders description: Sends a receipt for each placed order interaction: async via: platform:kafka channel: orders.placedImpact and path queries count the broker as a hop and as a dependency of both sides. An async Relationship with no broker (a webhook, a callback) leaves out via.
Gateways and proxies
Section titled “Gateways and proxies”An API gateway or reverse proxy (Apigee, Kong, nginx) is a Service in the path by default, technology naming the product and owner the Team that runs it. The consumer points to the gateway, and the gateway to the API:
# web, in the shop Projectrelationships: - to: platform:apigee description: Places orders through technology: HTTPS
# apigee, in the platform Projectapigee: name: API Gateway technology: Apigee owner: platform-team relationships: - to: shop:api description: Routes order requests to technology: HTTPSWhen the gateway is shared infrastructure nobody needs to see, leave it out: web points to the API directly with technology: HTTPS via Apigee. Impact and paths then skip the hop. Either way, the gateway’s URL is the API’s consumer-facing Deployment url. See ADR 0005.
Cross-Project
Section titled “Cross-Project”Declare only this Project’s outbound Relationships. When the provider isn’t in the Model, leave the Relationship out and tell the user it is a gap for the provider’s Team; create Elements only in this Project. A provider outside the organization may be added here as an External Service.
Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.