pattern

Anti-Corruption Layer in Integration

A translation boundary that keeps a legacy system's model, vocabulary and quirks from leaking into a new system that must integrate with it.

legacydddintegration

Integration with a legacy system exerts a steady pull: its data model, its field names, its status codes, its assumptions about what an entity is. Without a deliberate barrier, the new system's domain model gradually becomes a copy of the old one, and the modernisation delivers a new technology stack around the same conceptual mess.

The anti-corruption layer is the barrier. It sits at the boundary, speaks the legacy system's language on one side and the new domain's on the other, and performs the translation — mapping identifiers, converting representations, compensating for missing concepts, and absorbing the quirks that must not become permanent.

What it absorbs in practice is more than field mapping: batch-only availability, fixed-width formats, codes whose meaning is undocumented, entities that conflate two concepts the new model separates, and operations that are not idempotent.

The cost is a component to build and maintain, and the discipline required is to keep it thin and one-directional — translation only, no business logic — or it becomes a third system with its own model and its own bugs.

The strategic value beyond cleanliness: when the legacy system is eventually replaced, the change is confined to one side of the layer. Systems that integrated directly find that the replacement touches every consumer, which is frequently what makes decommissioning stall indefinitely.