An anticorruption layer (ACL) translates between a new domain model and a legacy model. It lets a new subsystem use its own concepts while still relying on older functionality. In a bubble migration, the new subsystem handles some logic itself and delegates the rest through the ACL. As more logic moves into the bubble, reliance on the legacy subsystem can shrink. section 12.4.2
Keeping a gigs platform running
A gigs platform first modernized its code while new and existing models still shared a database schema. As bounded contexts gained separate persistence schemas, an ACL kept the old model updated. When the new job-drafting and job-fulfillment contexts published a Job Published domain event, the ACL intercepted it and created a job in the legacy model. The old functionality remained operational while the team introduced changes gradually and A/B tested them. section 12.5
Figure 12.30 How the old legacy model is synced and updated through domain events from the new bounded context. The ACL is subscribed to the new domain events and then creates legacy jobs in the old legacy model.
Follow the event from the new bounded context through the ACL to the legacy job model to see where translation occurs. section 12.5
Treat the ACL as a migration cost, not a free boundary. Its translation logic can become more complex than the domain model it protects. Before choosing a bubble, weigh that cost against the freedom to evolve a fresh model. If the cost is too high, addressing the legacy subsystem directly—or conforming to its model—may be more practical. section 12.4.2


