A Core Design Rule in Model-Driven Data Engineering
Summary
InĀ Model-Driven Data Engineering (MDDE), data models arenāt static diagrams ā they areĀ semantic building blocksĀ that can be connected, versioned, validated, and automated.
Every model has its own role within the data platform, but whatās often forgotten is that models also needĀ internal structureĀ to remain maintainable as they evolve.
Thatās where theĀ Inbound ā Intermediate ā OutboundĀ principle comes in.
Itās a simple but powerful design rule that isolates change, simplifies mappings, and makes metadata-driven automation far more robust.

š” 1. From Diagrams to Declarative Models
In model-driven engineering, every data flow is described as aĀ connection between models. Each model defines:
- What data itĀ receivesĀ (inbound).
- How that data isĀ transformedĀ (intermediate).
- What data itĀ exposesĀ (outbound).
Without a clear distinction between these three roles, models quickly become tightly coupled, fragile, and difficult to refactor.
A good model doesnāt just define data ā it definesĀ how data flows through it_._
š§© 2. The Three Types of Entities
Each model consists of three logical layers of entities, each serving a distinct purpose in the platform.
š¹ Inbound Entities ā Controlled Entry Points
Inbound entitiesĀ represent theĀ formal input interfaceĀ of a model.
All external data entering the model must go through an inbound entity.
Each inbound entity maps to aĀ single source model, ensuring that:
- The dependency isĀ clearĀ andĀ maintainable.
- Source model changes affectĀ only one locationĀ in the dependent model.
Never connect multiple entities in a model directly to the same source model ā it multiplies maintenance effort and introduces inconsistency.
Example:
model: sales
inbound_entities:
– customer_in
– order_in
Each inbound entity acts like an adapter between the source and the internal model.
šø Intermediate Entities ā Private Transformation Steps
Intermediate entitiesĀ represent the modelāsĀ internal logic.
They are where transformations, joins, aggregations, and enrichment happen.
They can combine inbound data, apply business rules, or prepare results for publishing. However, they areĀ privateĀ to the model and shouldĀ neverĀ be exposed as a mapping source for other models.
Intermediate entities are like private functions in code ā essential internally, but invisible externally.
Example:
intermediate_entities:
– order_enriched
– customer_scored
š¹ Outbound Entities ā The Modelās Public Interface
Outbound entitiesĀ define theĀ published outputĀ of the model.
These are the entities that downstream models may map to.
Outbound entities together form theĀ contractĀ between the model and its consumers ā the only layer visible externally.
Only outbound entities should be used as mapping sources by dependent models.
Never expose intermediates; they are not part of your public API.
Example:
outbound_entities:
– order_summary
– customer360
āļø 3. The Mapping Rules
In a metadata-driven system, mappings describeĀ how entities connectĀ across models. To keep these mappings clean, we apply strict connection rules:
Press enter or click to view image in full size

These rules prevent tangled dependencies and make regeneration or refactoring of models safe and automatic.
š 4. Why This Matters ā Change Isolation
A well-structured model isolates change across three dimensions:
- When a source model changes:
Only the inbound entity (and its mapping) needs adjustment.
Other transformations remain untouched. - When internal logic changes:
Intermediate entities can evolve freely ā the inbound and outbound interfaces stay stable. - When consumers evolve:
As long as outbound entities maintain compatibility, downstream models remain unaffected.
The InboundāIntermediateāOutbound pattern turns every model into aĀ self-contained, modular boundary of meaningĀ ā independently changeable, traceable, and testable.
š§ 5. Validation, Testing, and Automation
Because these roles are defined declaratively in metadata, validation and governance can be automated:
- DetectĀ violationsĀ (e.g., intermediate-to-intermediate mappings between models).
- EnforceĀ dependency rulesĀ automatically during model generation.
- GenerateĀ lineage graphsĀ that clearly distinguish internal and external flows.
- Validate thatĀ all outbound entitiesĀ are mapped downstream (and intermediates are not).
This turns your model catalog into aĀ self-verifying metadata ecosystem.
š§© 6. Example: The Sales Domain Model
Hereās what a simple layered model looks like:
model: sales_domain
inbound_entities:
– customer_in
– order_in
intermediate_entities:
– enriched_orders
– joined_customer_orders
outbound_entities:
– order_summary
– customer_revenue
Each inbound entity maps from one source model (e.g., CRM or Orders).
š¹Intermediate entities combine and enrich data internally.
š¹Outbound entities define the modelās exposed results.
Lineage becomes clear:
CRM/Orders ā Inbound ā Intermediate ā Outbound ā Analytics
š§± 7. Interface Consistency Across Layers
This pattern scales elegantly across your entire platform.
- TheĀ Anti-Corruption LayerĀ acts as anĀ inbound interface modelĀ ā translating from legacy systems.
- TheĀ Common Integration LayerĀ defines the harmonized intermediate structures shared across domains.
- Downstream domains consumeĀ outbound entitiesĀ as their inbound interfaces.
Each layer follows the same rules ā isolation, clarity, and testability ā making your platformĀ semantically consistent from end to end.
š§¾ 8. Conclusion ā Models as Living Contracts
When data models follow theĀ Inbound ā Intermediate ā OutboundĀ structure, they become more than just SQL or YAML ā they becomeĀ living contractsĀ between layers.
Each model declares what it accepts, how it transforms, and what it delivers ā all governed by metadata.
š¹Great data platforms arenāt defined by the tools they use, but by theĀ discipline of their models.
š¹The InboundāIntermediateāOutbound pattern makes that discipline explicit, testable, and automatable.
š§© Metadata-Driven Architecture Series
1ļøā£Ā Scaling Metadata-Driven Data Modeling ā From Conceptual to Physical with Git and YAML
2ļøā£Ā Generating Logical Models Automatically from Conceptual Metadata
3ļøā£Ā The Common Integration Layer: Building a Harmonized Semantic Backbone (coming soon)
4ļøā£Ā The Metadata-Driven Anti-Corruption Layer
5ļøā£Ā Implementing the Anti-Corruption Layer in Practice
6ļøā£Ā Designing Layered Data Models with Inbound, Intermediate, and Outbound Entities š