August 4 2025
Anti-Corruption Between Internal Domains Without Becoming an Ornamental Layer
When one domain starts leaking language and rules into another, some translation is starting to become necessary.
Andrews Ribeiro
Founder & Engineer
3 min Intermediate Systems
The problem
As the backend grows, some modules start speaking too loudly.
Classic examples:
- billing becomes the language of the whole system
- catalog imposes structure on orders
- identity leaks concepts into authorization, CRM, and analytics
Then other domains stop speaking in their own language and start depending on:
- names
- flags
- states
- structures
that were not created for them.
Mental model
Anti-corruption is not “one more layer” by definition.
It is a translation point that protects one domain from silently absorbing someone else’s language or rules.
Inside the same backend, this can make sense when:
- models carry different semantics
- states with the same name mean different things
- one supplying domain starts deforming its consumers
Simple example
Imagine billing exposing invoice_status.
Orders start depending on that to decide:
- whether they can ship
- whether they can reopen
- whether they should refund
But orders should not think in terms of invoice_status.
They should think in something more like:
- payment confirmed
- payment pending
- payment irreconcilable
That translation is already one form of anti-corruption.
Not because the team wants to look like it does DDD.
But because the meanings are different.
The common mistake
The common mistake is creating a layer with a pretty name that, in practice, only does this:
- copy field A into field B
- rename one enum
- pass the payload forward
If there is no semantic, rule, or dependency protection, that is only one more corridor inside the system.
An ornamental layer makes the design bigger without making the boundary clearer.
When it is actually worth it
It is usually worth it when the translation:
- preserves the consumer domain’s vocabulary
- reduces dependence on the unstable structure of the supplier domain
- prevents one side’s rules from leaking into the other
If that protection does not exist, maybe a smaller direct contract is already enough.
How a senior thinks
More experienced engineers often ask:
- what concrete contamination am I trying to prevent?
- does this domain need to understand the original concept or only one translated effect?
- is the translation preserving autonomy or only creating ritual?
- if the supplier domain changes tomorrow, does the impact stay contained?
That conversation usually separates useful architecture from architecture cosplay.
Interview angle
This topic appears in modularization, DDD, and internal system design.
The interviewer wants to see whether you understand:
- that anti-corruption is a semantic-protection tool
- that not every boundary needs a dedicated layer
- that useful translation is the one that reduces real conceptual coupling
A strong answer often sounds like this:
“I would use a translation layer when one internal domain is leaking language or rules that do not belong to another. If the layer only forwards payload with different names, it is not protecting anything. The goal is to preserve autonomy without creating theater.”
Direct takeaway
Good internal anti-corruption does not exist to decorate the architecture.
It exists to stop one domain from colonizing another.
Quick summary
What to keep in your head
- Internal anti-corruption only makes sense when it protects one domain's language, rules, or model from another domain leaking into it.
- If the layer only renames fields without changing understanding, it is probably ornamental.
- Internal domains can also contaminate each other when one module becomes the conceptual supplier of the whole system.
- Good internal translation reduces dependence without creating useless ceremony.
Practice checklist
Use this when you answer
- Is one internal domain forcing its language or structure onto other modules?
- Does this translation protect rules and semantics, or only move data from one shape to another?
- Am I creating a layer because of real contamination or only because it looks architecturally correct?
- If I remove this layer, does conceptual coupling really get worse?
You finished this article
Share this page
Copy the link manually from the field below.