SIM — System Integration
This guide is split into three parts, and you are on Short info. Continue with the tutorial or browse the samples.
Summary
Section titled “Summary”SIM answers: which systems communicate, through what contracts, and under which constraints?
When to use it
Section titled “When to use it”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.
Common mistakes
Section titled “Common mistakes”- 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.
Background and history
Section titled “Background and history”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.
Alternatives and trade-offs
Section titled “Alternatives and trade-offs”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.
References
Section titled “References”- AsyncAPI’s document introduction
- Learning with models — choose a practice workflow and interpret its results.
What SIM Captures
Section titled “What SIM Captures”- 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
Why SIM Exists
Section titled “Why SIM Exists”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:
- Visual topology – see your entire system architecture at a glance
- Constraint propagation – when one service’s spec changes, understand which downstream services are affected
- Integration test generation – auto-generate contract tests and integration test scaffolding
- Deployment ordering – compute the correct deployment sequence from the dependency graph
What SIM Gives You
Section titled “What SIM Gives You”| 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 |
Relationships to Other Models
Section titled “Relationships to Other Models”- 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
Next Steps
Section titled “Next Steps”- DDD Model to define aggregates within each service
- Multi-Service SaaS Tutorial for a complete walkthrough
- Recipes Overview to understand how SIM affects recipe generation
File format (JSON Schema)
Section titled “File format (JSON Schema)”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.
