Skip to content

Context Map — Strategic DDD

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

A Context Map answers: where do meanings and ownership change, and what relationships connect those boundaries?

Use it when teams, subsystems or external providers interpret related concepts differently. Start with two bounded contexts and a deliberately chosen relationship. A bounded context can live inside a monolith; deploying microservices is not a prerequisite. Focus on language, dependency direction and collaboration rather than drawing the network.

  • Drawing deployment boundaries and assuming they establish domain meanings.
  • Leaving dependency direction or ownership ambiguous.
  • Choosing a relationship pattern without discussing its change and coordination costs.

Context mapping is part of strategic Domain-Driven Design. It describes relationships between bounded contexts instead of the internal design of an aggregate. Context Mapper’s reference makes these patterns concrete in a modeling language, while ContextBrew offers its own representation and an import/export subset.

The pattern on an edge is a design decision. A downstream team may accept an upstream model, negotiate a customer–supplier relationship, or translate through an anticorruption layer. The correct choice depends on control, collaboration and change cost. Show direction and ownership so reviewers can discuss those consequences. A strategic relationship does not by itself specify a wire protocol; connect it to SIM when the integration contract needs detail.

A team ownership map emphasizes responsibility, C4 emphasizes architecture, and SIM emphasizes technical interaction. A generic dependency graph is cheaper but loses the relationship vocabulary. Bounded Contexts is a related facet view for inspecting boundaries, not a second independent strategic authority.

Model Captures Use case
DDD Domain (aggregates, invariants) Tactical
Context Map Bounded contexts + integration patterns Strategic
ESDM Event-sourced tactical decomposition Tactical + integration
C4 Static architecture Architecture

Nine patterns, grouped:

  • Symmetric (mutual): Partnership · Shared Kernel
  • Asymmetric (upstream/downstream): Customer-Supplier · Conformist · Anticorruption Layer
  • Open-host (publish / consume): Open Host Service · Published Language
  • Quarantine / anti-patterns: Separate Ways · Big Ball of Mud

Every edge in the file carries one of these pattern literals.

Stored as models/context-map.json. See the context-map schema page for the normative JSON Schema and committed sample files.

Each context can carry termIds (its owned ubiquitous-language terms) which feed the cross-model consistency validator. The context IDs are referenced by DDD aggregate scopes and by ESDM boundedContext names.