Architect Serverless Applications with Anticorruption Layers

Sheen Brisals
Level Up Coding
Published in
9 min readApr 18, 2024

Credit: Microsoft stock image

Prevention is better than cure!

This popular proverb is believed to be from the 1500s.

It is easier to stop a problem from happening than to repair the damage after it has happened.

The anti-corruption layer concept as a preventive and protective measure has existed for centuries in medicine, manufacturing, labs, and other industries.

In software, the anticorruption layer (ACL) gained attention as a pattern after Eric Evans' seminal book Domain-Driven Design: Tackling Complexity in the Heart of Software (Addison-Wesley Professional) was published.

In software, ACL also serves the same purpose: prevention and protection.

Team X was autonomous; guarded its bounded context — Orders.

Engineers built APIs to operate on order data and published (domain) events on an event broker. They used a third-party order management system (OMS) as an order store and interacted with a few internal systems.

For unknown reasons, the team didn’t spend time building a sophisticated domain model. Instead, they mirrored part of the OMS. Their APIs behaved like proxies with business logic scattered everywhere.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Sheen Brisals

Co-author of Serverless Development on AWS (O'Reilly, 2024) | Engineer. Architect. Leader. Writer. Speaker. AWS Serverless Hero.

Responses (3)

What are your thoughts?

Good article, Sheen. The ACL is a good way of improving quality and security when getting data from an untrusted source.

Thanks, Sheen. Well-written and thought provoking article.
We use DDD and it is an issue we've had to address.

I totally get how crucial this is, especially during migrations to microservices. The idea of decoupling and translating domain model semantics seamlessly is key for maintaining system integrity...
How can the Anti-Corruption Layer pattern be applied…...