Skip to content

SIM — System Integration

This guide is split into three parts, and you are on Short info. Continue with the tutorial or browse the samples.

SIM answers: which systems communicate, through what contracts, and under which constraints?

Use it when behavior crosses a service, bounded-context or external-system boundary. Begin with two participants, one interaction and a declared contract. Include failure assumptions such as timeout, delivery and retry behavior in the accompanying explanation. A single application with no meaningful integration boundary may not need a separate topology.

  • Using an arrow without stating what the interaction means.
  • Treating a timeout as proof that the remote action failed.
  • Confusing a strategic team relationship with a technical wire contract.

SIM is ContextBrew’s integration model, bringing service relationships and contracts into the same specification workflow as domain and requirements models. It draws on established API and event-driven design concerns rather than introducing a universal integration standard. AsyncAPI’s document introduction explains a complementary vocabulary for describing event-driven interfaces.

A line between services is only the beginning of an integration contract. The participants must agree on meaning, payload and relevant operating constraints. Keep the strategic relationship in Context Map and the architectural placement in C4; use SIM to make the interaction explicit. Constraint propagation and structural validation should be read within their supported scope. A topology diagram does not demonstrate real network behavior, delivery guarantees or recovery from an outage.

OpenAPI focuses on HTTP interfaces, AsyncAPI on event-driven interface descriptions, and sequence diagrams on a particular interaction over time. C4 gives architectural context; Context Map explains the strategic relationship. Use them together when they answer different questions.

  • Services – independent deployable units (microservices, serverless functions, monolith modules)
  • Connections – directed edges representing inter-service communication (sync REST/gRPC, async events)
  • Data Contracts – schemas for messages passed between services
  • Constraints – rules governing inter-service behavior (e.g., “Order Service must not directly access Payment DB”)
  • Dependencies – service dependency graph used for deployment ordering

When you have multiple services, each with its own DDD aggregates, USM stories, and CBRL requirements, you need a way to model how they interact. SIM provides:

  1. Visual topology – see your entire system architecture at a glance
  2. Constraint propagation – when one service’s spec changes, understand which downstream services are affected
  3. Integration test generation – auto-generate contract tests and integration test scaffolding
  4. Deployment ordering – compute the correct deployment sequence from the dependency graph
Capability Description
Dependency DAG The deployment and impact ordering, read straight off the edges
Typed contracts API / event / database contracts bound to each dependency edge, with versioning strategy and status
Cross-cutting invariants Architectural rules (e.g. “no shared tables”) with severity and category, checked by the consistency gate
Consistency verdict ctxbrew validate-consistency --sim — blocking on critical/major findings
Recipe scoping Each service’s aggregates generate tests and recipes scoped to that service
  • DDD – Each service owns a set of DDD aggregates; cross-service references become SIM connections
  • USM – Stories that span multiple services reference the SIM topology
  • CBRL – Requirements about inter-service behavior reference SIM constraints
  • SCM – Screens in one service that trigger actions in another are traced through SIM
  • DSM – Tables owned by each service are scoped; cross-service DB access violations are flagged

The serialized SIM model (models/sim.json inside a .ctxbrew archive) is validated by a normative JSON Schema generated from ContextBrew’s source code. See the SIM file schema page — or print the schema anywhere with ctxbrew schema sim.