Insights · Modernization

Domain-driven design decoupling: carve the system along the domain’s seams

Microservices

Key takeaway

Draw bounded contexts where a term means one thing, let each own its model and data, and connect them through translated integrations.

Most “tightly coupled” systems are not coupled by accident; they are coupled to the wrong thing. A shared customer table, a canonical enterprise data model, one schema serving filing, payment and correspondence — each couples every change in every domain to a model none of them fully controls. Eric Evans’s Domain-Driven Design (2003) begins from the opposite premise: the model that serves one part of the business well will distort another, so the design’s first job is deciding where the models end. That is what makes DDD a decoupling discipline, not a naming exercise.

Bounded contexts: one model per seam

The bounded context is the unit of decoupling. Fowler’s bliki entry puts Evans’s insight plainly: “total unification of the domain model for a large system will not be feasible or cost-effective.” Instead, each context holds an internally consistent model, and — this is the part teams miss — the boundaries are drawn by language: “you need a different model when the language changes.” Claim in the taxpayer context is not claim in the audit context; meter in the electricity-supply example means different things to billing and to field operations. When the same word needs two definitions, you have found a context boundary, and pretending otherwise produces the classic integration tangle: code full of “if the customer is X, then…”, where X is a tax domain wearing an invoicing domain’s clothes.

Operationally, a bounded context is a claim of ownership:

  • One team owns the context’s model and its evolution.
  • The context owns its persistence — no other context reads its tables. Shared schemas are unbounded contexts.
  • Everything crossing the boundary is an explicit contract, translated at the edge.

Ubiquitous language: the decoupling tool nobody prices

Fowler’s entry on ubiquitous language captures Evans’s point that the model and the vocabulary are the same artifact: a “common, rigorous language between developers and users”, built on the domain model, tested by using it in conversation with domain experts, and evolved as understanding grows. Rigor matters because “software doesn’t cope well with ambiguity.” In decoupling terms, the language is the detector: the moment a workshop needs forty minutes to disambiguate taxpayer, you have discovered two contexts that were about to be welded together. The cheapest moment to split them is that workshop, not the quarter after the shared database ships.

Context maps and the anti-corruption layer

Contexts must still talk to each other. DDD’s answer is to make the integrations first-class: a context map records how each pair of contexts relates (shared kernel, customer–supplier, conformist, published language…), and the anti-corruption layer (ACL) is the standard mechanism where semantics differ. Microsoft’s pattern description — which credits Evans as the originator — defines it exactly: a “facade or adapter layer between different subsystems that don’t share the same semantics” that “translates requests that one subsystem makes to the other”, so that “dependencies on outside subsystems don’t limit an application’s design.”

The ACL is the single highest-leverage pattern when a modern system must live beside a legacy one: the new domain model never adopts legacy table shapes, legacy status codes, or legacy protocols — translation happens in one owned place. Azure’s guidance is equally direct about the price: the layer adds latency, an extra service to operate, and consistency concerns — costs you accept deliberately, at boundaries worth protecting, not everywhere.

Decompose by business capability, not by technical layer

Where do the first contexts come from? The decompose-by-business-capability pattern gives the stable answer: define services (or modules) around what the business does to generate value — for a tax authority, taxpayer registration, filing, assessment, payment, debt. Two properties make this decomposition durable: capabilities are “relatively stable” while technologies churn, and the resulting components obey the Common Closure Principle — most changes affect one component, which is the practical definition of decoupled. Organization structure and a high-level domain model are the inputs; iteration is expected.

This is also where DDD earns its keep on a modernization rather than a greenfield: the capability map is drawn from how the business actually operates, so the seams you cut are the seams the organization already lives along.

Tactical patterns: aggregates and domain events inside the seam

Inside a context, Evans’s tactical building blocks keep the model and the implementation aligned: entities and value objects, aggregates that treat a cluster of objects as one consistency unit, repositories, and domain events. Two rules do most of the decoupling work:

  • One transaction, one aggregate. Aggregate boundaries are transaction boundaries; if a use case must mutate two aggregates atomically, either the boundary is wrong or the workflow should be event-driven, not transactionally entangled.
  • Domain events cross seams, never tables. When the payment context needs to know a return was assessed, it subscribes to an event. The event — not a foreign join — is the integration, which is what lets each context refactor its internals freely.

What this looked like on a national tax platform

On the E-Tax modernization, the decomposition that mattered was drawn around taxpayer, filing, assessment, and payment — each with its own model and its own persistence — while anti-corruption layers wrapped the legacy systems the new domains had to interoperate with. Two of the programme’s recorded decisions followed directly from the strategic design: default-strict mTLS between contexts (independent trust per domain) and the event backbone as the integration spine (domain events as contracts). The seams were chosen before the services were, which is why they have survived three years of change without re-litigation. The programme’s decision records — written the way this site describes — are the audit trail of that carving.

How deep should you go?

The research picture supports restraint. A 2024 systematic literature review of DDD in microservices-based systems development (Sangabriel Alarcón et al. — artifacts on Zenodo, published version at IEEE) finds bounded contexts and context mapping among the most-applied strategic patterns, while noting that practical guidance for applying them remains thin — which matches field reality: teams that adopt the tactical vocabulary without the strategic carving get event spaghetti inside an unbounded context, the worst of both worlds. The sequence that works: strategic design first (contexts, language, maps), tactical patterns second, and service extraction only where a seam has proven itself — often as a modular monolith first, per the migration evidence in the strangler-fig literature (Faustino et al.’s stepwise migration study is the citable version).

Carve your domains with us

Sources