.NET Architecture & System Design Interview Question #122

What is an Anti-Corruption Layer between systems?

Microservices, API Gateway, Service Communication & Event-Driven Architecture Mid-Level Intermediate

Quick Interview Answer

An Anti-Corruption Layer translates between an external system's model and the application's own model. It prevents foreign terminology, schemas, and design decisions from spreading through the internal domain.

Detailed Explanation

An Anti-Corruption Layer translates between an external system's model and the application's own model. It prevents foreign terminology, schemas, and design decisions from spreading through the internal domain.

The layer can contain adapters, translators, and mapping logic. It is especially useful when integrating legacy systems or third-party APIs whose models do not align with the application's concepts.

Code Example

External CRM Model
       |
Anti-Corruption Layer
       |
Internal Customer Model