# Anti-Corruption Layer

> Translator between your clean new domain model and the gnarly legacy one.

- **Category**: Microservices
- **Subcategory**: Migration & Refactoring
- **Canonical URL**: https://designpattern.fyi/patterns/anti_corruption_layer/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Legacy system uses "ClientAccount" with 40 fields. New Customer Service uses a clean "Customer" aggregate. ACL maps ClientAccount → Customer on every call, keeping your new model pristine.





## Trade-offs


### Advantages

- New services stay clean — zero legacy contamination

- Enables incremental migration without big bang rewrites

- Clear explicit translation layer = easier to audit and replace

- Teams can work independently on each side




### Considerations & Drawbacks

- Extra code to write and maintain (the ACL itself)

- Translation layer can lag if legacy model changes frequently

- Adds a runtime hop / potential latency

- Can become complex if legacy model is deeply inconsistent







---
**Reference**: [Original Source](https://microservices.io/patterns/refactoring/anti-corruption-layer.html)

