Connect Services
A Relationship says that a consumer depends on a provider. See Relationships for why they point the way they do.
A call
Section titled “A call”Under the consumer, add a relationships entry pointing to the provider:
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- Write the
descriptionas a verb phrase that completes “consumer … provider”: “Stores payment state in”. - Put the protocol or format in
technology: “JDBC”, “JSON/HTTPS”, “gRPC”. - Declare it at the most detailed level you know: between Components if the code shows which part calls which, else between Services. Edges between Systems are derived from these.
To another Project
Section titled “To another Project”Name a provider in another Project by its Qualified id, project:id, as core:mainframe above. Declare only your Project’s outbound Relationships: the provider’s Team declares its own. If the provider isn’t in the Model yet, leave the Relationship out and tell its Team; don’t declare another Team’s Elements in your Project.
A provider outside the organisation, such as a payment provider’s API, can be declared in your Project as an External Service.
Through a broker
Section titled “Through a broker”An event is declared by the Subscriber, pointing to the Publisher whose events it depends on, with interaction: async, via the broker Service and channel the topic or queue:
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.initiatedThe broker must be a Service with type: broker (via-not-broker). Leave out interaction: async and check refuses via and channel:
services: orders: name: Orders events: name: Events type: broker mailer: name: Mailer relationships: - to: orders description: Emails a receipt for each placed order via: events channel: orders.placedThat is via-on-sync: add interaction: async to the Relationship. An async Relationship with no broker, such as a webhook, has interaction: async and no via.
Check it
Section titled “Check it”archidocs checkThen look at it in the viewer: archidocs dev, select the consumer, and its new Relationship is listed in the Element panel and drawn on the Views that show both ends.
With an agent
Section titled “With an agent”upsert_relationship adds or updates one, and search_elements resolves a provider’s name, URL or host to its Qualified id.