⚡THE SHORT ANSWER
In Domain-Driven Design (DDD), defining isolated Bounded Contexts is only half the battle; the real complexity lies in how contexts relate, integrate, and exchange data. If two teams share a database table or publish unversioned internal models, they silently degenerate into a tightly coupled distributed monolith. Eric Evans defined Context Mapping to explicitly formalize architectural and team boundaries:
Shared Kernel: Two contexts explicitly share a small, tightly controlled subset of code/domain model, requiring joint approval for any change.
Customer-Supplier (Upstream/Downstream - U/D): The Upstream supplier team must deliver features requested by the Downstream customer team.
Conformist: Downstream has no leverage and must conform 100% to Upstream's model.
Anti-Corruption Layer (ACL): Downstream builds a translation layer to protect its domain purity from a messy Upstream model.
Open Host Service (OHS) / Published Language (PL): Upstream exposes a stable, documented public protocol (e.g. REST/Protobuf) for multiple consumers.
Engineering Handbook & Failure Dynamics
6-Dimensional Architecture Breakdown⚙️1. Underlying Mechanism
Execution🎯2. Appropriate Use Context
Scope⚠️3. Production Failure Modes
P0 Risk📡4. Diagnostic Signals & Telemetry
Telemetry🛡️5. Prevention & Safeguards
Safeguards⚖️6. Architectural Trade-offs
Trade-offCase Study (TinyCTO In-Field Example)
A retail company's modern Recommendation microservice integrated with a 15-year-old COBOL Inventory monolith. Initially, the team conformed directly, importing the legacy INV_ITEM_MST_V1 schema. When the legacy team renamed column codes, the recommendation engine crashed in production. The team introduced an Anti-Corruption Layer (ACL): an adapter service consumed the legacy feed and translated it into a clean, modern ProductCatalog domain model. Subsequent breaking changes in the COBOL monolith were absorbed entirely within the ACL adapter, with zero downtime or code changes in the recommendation engine.
Interactive Concept Drills
2 CardsWhat is an Anti-Corruption Layer (ACL) in DDD Context Mapping?
Why is a Shared Kernel risky if not strictly governed?
Strategic Domain-Driven Design: Context Mapping, Shared Kernel & Customer-Supplier Relationships — Technical FAQ
What does 'Upstream' (U) and 'Downstream' (D) mean in Context Mapping?
Upstream (U) is the provider whose changes influence Downstream; Downstream (D) is the consumer whose software is affected by Upstream's decisions.
What is an Open Host Service (OHS)?
A protocol or public API (REST/gRPC) provided by an upstream subsystem that gives access to multiple downstream systems through a stable published language.
🤖 AEO & Key Facts Summary
Key Architectural Facts
- ▸
Context Mapping defines strategic integration and organizational relationships between bounded contexts.
- ▸
Use Anti-Corruption Layers (ACL) to shield modern domain logic from legacy models.
- ▸
Shared Kernels must be strictly limited to prevent deployment lockstep.
- ▸
Upstream/Downstream mappings make power dynamics and technical dependencies explicit.
Common Misconceptions
- ✗
Yanılgı: Microservices should share common database tables to stay in sync (Gerçek: Database sharing creates catastrophic distributed monolith coupling and schema deadlock).
- ✗
Yanılgı: Every integration requires an ACL (Gerçek: If the upstream API is well-designed and stable (OHS/PL), direct consumption or Conformist may be acceptable).
Decision & Governance Guidance
Document explicit Context Maps in architecture blueprints to clarify team contracts and isolate domain models across enterprise microservices.
Authoritative Sources & Standards
- [BOOK]Domain-Driven Design: Tackling Complexity in the Heart of Software (Strategic Design & Context Mapping)— Eric Evans (Addison-Wesley Professional)
