A tangled ball of coloured yarn The same yarn as six straight, separate strands

Charting the Uncharted

Discovering and evolving
bounded contexts

DDD Europe

Prem Chandrasekaran

June 2025

The domain complexity challenge

A tangled ball of coloured yarn

The Problem

Business domains are complex and abstract, making software hard to design

The domain complexity challenge

DDD’s Promise

The yarn as six straight, separate strands of colour

Break down complexity

by dividing the

domain

into smaller parts —

subdomains

with clear boundaries —

bounded contexts

Domain

Subdomains

Bounded contexts

Domain

Subdomains

Bounded contexts

The broad business problem area

Domain

The broad business problem area

Subdomains

Bounded contexts

Online Retail

Domain

Subdomains

Bounded contexts

A smaller, well-defined area of knowledge or responsibility within a domain

Domain

The broad business problem area

Subdomains

A smaller, well-defined area of knowledge or responsibility within a domain

Bounded contexts

Online Retail

Ordering / Checkout

Product Catalog

Payment Processing

Inventory & Fulfillment

Customer Service / Support

Customer Accounts & Identity

Marketing & Recommendations

Domain

The broad business problem area

Subdomains

A smaller, well-defined area of knowledge or responsibility within a domain

Bounded contexts

Parts of the solution with explicit model and language boundaries

Quiz time: Which decomposition is right?

A

B

C

Subdomain

Bounded Context

Domain

The broad business problem area

Subdomains

A smaller, well-defined area of knowledge or responsibility within a domain

Bounded contexts

Parts of the solution with explicit model and language boundaries

Online Retail

Ordering / Checkout

Product Catalog

Payment Processing

Inventory & Fulfillment

Customer Service / Support

Customer Accounts & Identity

Marketing & Recommendations

Catalog Core
Cart & Checkout
Pricing & Promos
Pricing & Promos
Payment Gateway
Inventory Reservation
Customer Profile
Customer Support Portal

Domain

The broad business problem area

Subdomains

A smaller, well-defined area of knowledge or responsibility within a domain

Bounded contexts

Parts of the solution with explicit model and language boundaries

Online Retail

Ordering / Checkout

Product Catalog

Payment Processing

Inventory & Fulfillment

Customer Service / Support

Customer Accounts & Identity

Marketing & Recommendations

Catalog Core
Cart & Checkout
Pricing & Promos
Pricing & Promos
Payment Gateway
Inventory Reservation
Customer Profile
Customer Support Portal
Warehouse Execution
Shipping Carrier Integration
Fraud Screening
Fraud Screening
Pricing & Promos

Domain

The broad business problem area

Subdomains

A smaller, well-defined area of knowledge or responsibility within a domain

Bounded contexts

Parts of the solution with explicit model and language boundaries

Online Retail

Ordering / Checkout

Product Catalog

Payment Processing

Inventory & Fulfillment

Customer Service / Support

Customer Accounts & Identity

Marketing & Recommendations

Catalog Core
Cart & Checkout
Pricing & Promos
Pricing & Promos
Payment Gateway
Inventory Reservation
Customer Profile
Customer Support Portal
Warehouse Execution
Shipping Carrier Integration
Fraud Screening
Fraud Screening
Pricing & Promos
Loyalty & Rewards
Loyalty & Rewards
Recommendation Engine
Recommendation Engine
Returns
Returns
Customer Support Portal
Customer Support Portal
Customer Support Portal

From theory to the trenches

Spotting bounded context pitfalls

Part 2

An episodic guide to boundary design

The Situation

The Impact

The Fix

S1: Lost in Translation

Episode 1

The “Status” Shuffle

What “complete” really means?

The word COMPLETE? in large letters, circled by a container ship, a server, a calendar and a question mark

Can you spot it?

Team Alpha’s “Complete” conundrum

Developer👩🏽
Just pushed the code. The order is marked “Complete” in the DB once payment is verified.
Tester👨🏻‍🦱
Hang on. For my tests, “Complete” means all items are shipped and tracking number emailed.
Product Owner👵🏼
Hmm, in my report, an order is only ‘Complete’ after the 14-day return period has expired.
Support👱🏼‍♂️
The customer sees their order as ‘Processing’, not ‘Complete’. This is confusing!

Lost in Translation!

When “Complete” causes complete chaos!

The Problem

The term “Complete” is dangerously ambiguous. It holds multiple, conflicting definitions within this single team and their Order Processing context.

So What?

🐞

Bugs & Rework

Code conflicts emerge when “Complete” means different things. Premature emails go out before packages ship.

🗓️

Wasted Time

Teams debate endlessly over what should be crystal clear. Hours vanish explaining the unexplainable.

📊

Misleading Metrics

Reports become meaningless when built on ambiguous data. Business decisions suffer from shaky foundations.

😡

Customer Frustration

Trust erodes when support says “Complete” but packages haven’t shipped. New team members inherit the confusion.

The Fix?

Create clarity with a Ubiquitous Language

A more crisp vocabulary

  • PaymentVerified: Customer payment confirmed.
  • ItemsAllocated: Stock reserved for the order.
  • OrderShipped: Package dispatched, tracking available.
  • ShipmentDelivered: Confirmed delivery to customer.
  • ReturnWindowActive: Period during which returns are accepted.
  • OrderClosed: Final state, post-return window or successful resolution.

Building your shared language

  • Forge a Ubiquitous Language: Explicitly define key terms within your Bounded Context. This is your team’s shared, precise language.
  • Deconstruct Ambiguity: If a term like “Complete” is overloaded, replace it with more specific, unambiguous terms that describe distinct states or events.
  • Make It Visible & Accessible: Document these terms (wiki, diagrams, code comments). Model it. Put it on the wall!
  • Live and Breathe It: Use these exact terms in all team communications: verbal, code, tests, UI text, documentation.
  • Guard It: Actively challenge and clarify fuzzy language. “What precisely do we mean by ‘ready’ in this context?”

S1: Lost in Translation

Episode 2

The “Customer” Chameleon

Is your “Customer” my “Customer”?

A chameleon on a branch between two rooms, its colours shifting to match each side

Can you spot it?

The cross-department “Customer” conundrum

Sales
context

Shipping
context

👩🏽Maria
Success! Just signed up 'MegaCorp Inc.' as a new 'Customer'! They're ID CUST-001. They want 1000 units of our SuperWidget, ASAP! Entered them into the CRM. (Sales CRM shows "Customer: MegaCorp Inc., Status: Active")
Right, got the order for 'Customer' CUST-001, MegaCorp. But wait... the system says this 'Customer' has no 'Verified Shipping Address', no 'Loading Dock Specs', and no 'Receiving Hours' on file. My team can't even start picking the order. For us, a 'Customer' isn't actionable until all that logistical info is confirmed! (Shipping system shows "Customer: MegaCorp Inc., Status: Incomplete Logistics Profile")
Bob👴🏼

Lost in Translation!

When a “Customer” isn’t ready for prime time (Shipping)!

Sales
context

Customer

Shipping
context

⚠️⁇Customer⁇⚠️

The Problem

The term "Customer" bleeds from the Sales Context (where it means a contractual entity) into the Shipping Context (where it implies a logistically ready entity) without translation or acknowledging different contextual needs.

So What?

🚛⏳

Operational Delays

Shipping can't proceed, orders get stuck.

🏢💰

Wasted Resources

Warehouse staff might prepare for an order that isn't ready for them.

👉👈

Friction

"Sales just throws stuff over the wall!" vs. "Why can't Shipping just figure it out?!"

❌😑

Poor Planning

Inaccurate forecasting for warehouse workload

The Fix?

Define boundaries & translate!

Sales
context

Shipping
context

Customer

LogisticsProspect

ACL

U

D

How we can do better

  • Recognize Different Contexts: Acknowledge that Sales and Shipping have different models and priorities for what a "Customer" signifies.
  • Define Your Own Language: Shipping should develop its own Ubiquitous Language for its needs (e.g. LogisticsProspect, ShippableOrder, Recipient, etc.).
  • Guard Your Boundaries: Protect your Bounded Context from being corrupted by another context's language.
  • Translate Explicitly: Use an Anti-Corruption Layer (ACL) or other explicit translation mechanisms when information crosses context boundaries. Don't just pass terms through.
  • Context Map: Clearly map the relationships and translations between bounded contexts.

S1: Lost in Translation

Episode 3

The Dictionary Dictatorship!

When “One Size Fits All”… Fits No One

A huge book stamped DATA INTEGRITY FIRST crushes a row of smaller books

Can you spot it?

The all-encompassing “Party” problem

📣Memo
"Effective Q3: All systems will standardize on the Enterprise 'Party' Model. A 'Party' can be an individual, organization, employee, customer, vendor, or internal department. The 'Party' object contains 275 attributes, including 'DateOfBirth' (for individuals), 'VATNumber' (for organizations), 'EmployeeID' (for staff), 'LoyaltyTier' (for customers), and 'ForkliftCertificationExpiry' (for specific warehouse roles)
So, for every website visitor we track as a 'Party,' we now have to consider 'ForkliftCertificationExpiry'? That's... a lot of irrelevant data for our analytics.
Marketing Team Lead👩🏽
And our 'Party' representing a 'LoadingBayDoor' (an internal operational entity) now needs a 'DateOfBirth' and 'LoyaltyTier'? This model is making simple things very complicated for us.
Warehouse System Dev👱🏼‍♂️
Trying to map our detailed 'Employee' structure with its specific payroll and benefits fields into this generic 'Party' model is a nightmare for reporting.
HR System Analyst👵🏼

Lost in Translation!

The tyranny of the universal model!

Marketing
Warehouse
HR
Party

😧

🙄

😵‍💫

The Problem

A single, overly generalized model ("Party") is forced onto diverse Bounded Contexts, each with its own specific needs, language, and understanding of similar-but-different concepts (e.g., a website visitor vs. a loading bay door vs. an employee).

So What?

🥴

Bloat & Complexity

Models and systems become unnecessarily large and complex, carrying tons of irrelevant data for any given context.

🤨

Loss of Precision

The specific nuances of "Employee" in HR or "AutomatedGuidedVehicle" in the Warehouse are lost in the generic "Party."

🧩

Increased Effort

Teams struggle to map their specific needs to the generic model, or work around its limitations.

🐌

Reduced Agility

Changing the "Universal Model" becomes a monumental task affecting everyone, stifling innovation in individual contexts.

The Fix?

Embrace context-specific languages!

Party

❌

Marketing
Warehouse
HR

😅

😅

😅

Avoid creating the one ring to rule them all

The Fix?

Embrace context-specific languages!

Marketing
Warehouse
HR

How we can do better

  • Context is Everything: Each Bounded Context should define its OWN model and Ubiquitous Language, optimized for its specific purpose.
  • Model What You Need: Keep models lean and focused on the relevant attributes and behaviors for that context.
  • Strategic Duplication Can Be Good: It's okay if "ID" or "Name" appears in different context-specific models. This is better than forced, complex conformity.
  • Integrate Explicitly & Sparingly: When contexts must share data, do it through well-defined APIs/events (Open-Host Service), and explicit translations (ACLs), sharing only what's necessary. Don't try to share the entire model.
  • Strategic DDD, Not Accidental Silos: This isn't about creating isolated kingdoms that don't talk. It's about intentional boundaries and intentional communication.

S2: Boundary Blunders

Episode 1

The Colossal Context!

When your service tries to be a universe

An overstuffed suitcase spilling code printouts, database cylinders, scrolls and a typewriter

Can you spot it?

The “Monolith Maximus” service

👩🏽Dev Lead
We need to update the password policy in UserProfiles. Should be quick.
Careful, Deepa. The BillingEngine directly reads user data, and the MarketingCampaigns module has some weird coupling to user profile flags. A change there last year broke reporting for a week.
Senior Dev👨🏻‍🦱
🧑🏽‍🦳Product Owner
Can we add a 'Buy Now, Pay Later' option to OrderProcessing? It's a top priority for Q3.
That means touching ProductCatalog for eligibility, UserProfiles for credit checks, BillingEngine for new payment schedules, and ReportingSuite for new metrics. Given the dependencies in 'Monolith Maximus', that's a 6-month project, best case, with extensive regression.
Architect👧🏻

Lost in the labyrinth!

The “Big Ball of Mud” context – too entangled to evolve!

The Problem

The "CoreBusinessPlatformService" is a "Big Ball of Mud" Bounded Context. It incorrectly bundles numerous distinct business domains (User Management, Product Catalog, Ordering, Billing, Marketing, etc.) into a single, tightly coupled monster.

So What?

🐌🐌

Slow Development

Even small changes require understanding a vast, interconnected codebase, leading to long lead times (Luis's 6-month estimate).

💣💣

Sky-High Risk of Failure

A bug in a less critical part (e.g., Marketing Campaigns) can destabilize core functions (e.g., Billing). Every deployment is a nail-biter.

🧠🧠

Massive Cognitive Load

No single developer can reasonably understand the entire system. Onboarding is a nightmare.

⚖️😵‍💫

Inflexible Scaling

You can't scale Billing independently of User Profiles or Marketing if they're all one deployment unit.

The Fix?

Find the seams, define clear contexts!

A tangled ball of string One strand pulled free of the ball Three strands pulled free of a smaller ball Four straight strands beside a small remaining ball

How we can do better

  • Identify True Business Domains: Look for the natural "seams" or distinct areas of business capability hidden within the monolith. What are the different "jobs" it's doing?
  • Carve Out Cohesive Bounded Contexts: Define clear boundaries around these identified domains with a single, well-understood responsibility.
  • One Context, One Team (Ideally): Align development teams to these new Bounded Contexts. This fosters ownership, expertise, and autonomy (Conway's Law to your advantage!).
  • Establish Explicit Contracts: Define how these contexts interact – through clear, published APIs or domain events. No more hidden, internal tentacles.
  • Embrace Independent Evolution: Each context can now choose its own tech (if appropriate), scale independently, and evolve at its own pace.
  • Start Strategically (Strangler Fig): Gradually "strangle" the monolith by carving out new contexts one by one, starting with the most beneficial or easiest ones. More at: https://www.thoughtworks.com/insights/articles/embracing-strangler-fig-pattern-legacy-modernization-part-one

S2: Boundary Blunders

Episode 2

The Layer Cake Illusion

When you just have slices of tech

Stacked slabs like layers of a cake, cut through with holes and stairs

Can you spot it?

The “Horizontal Slice” hangup

👩🏽Product Manager
We need to add a 'Country of Origin' field for our Products. It needs to show on the product page, be validated in the business rules, and stored in the database.
Tom, in "UserInterfaceContext": "Okay, we'll add the field to the screen in our context. We'll call the BusinessLogicContext to handle it."
UI Team Lead👨🏻‍🦱
🧑🏽‍🦳Backend Team Lead
Got it. We'll add the validation rule for 'Country of Origin' in our context and then tell the DataAccessContext to save it.
Alright, we'll update the Product table schema in our context to include 'CountryOfOrigin'
Data Team Lead👧🏻
👴🏼Architect
So, for this one small feature, three 'contexts' need to be coordinated, deployed, and potentially versioned together. Doesn't feel very independent, does it?

Lost in the layers!

Technical layers aren't business boundaries!

UI
Business Logic
Data Access

Manage Products

Manage Orders

The Problem

Bounded Contexts are mistakenly aligned with technical layers (UI, Logic, Data) instead of cohesive business domain capabilities (e.g., Product Management, Order Management).

So What?

⛓

High Feature Coupling

Most business features require changes across all these "technical contexts," defeating the purpose of independent evolution.

🪢

Synchronized Deployments

You often can't deploy the "UI Context" without deploying the corresponding "Business Logic Context" and "Data Access Context" changes.

🧶

Fragmented Knowledge

No single team owns a business capability end-to-end. Product domain logic is smeared across layers, owned by different specialist teams.

⛓️‍💥

Communication Overhead

Constant hand-offs and coordination between layer-teams for every feature.

The Fix?

Slice vertically, not horizontally!

UI
Business Logic
Data Access

Manage Products

Manage Orders

How we can do better

  • Focus on Business Capabilities: Identify distinct areas of business functionality (e.g., Product Catalog, Inventory, Orders). These are your candidate bounded contexts.
  • Vertical Slices: A bounded context should own its domain logic, its data, and often its UI components related to that specific domain, end-to-end.
  • One Context, One Team (Ideally): Align development teams to these new bounded contexts. This fosters ownership, expertise, and autonomy (Conway's Law to your advantage!).
  • Cross-Functional Teams: Align teams around these domain-centric bounded contexts, not around technical layers. A "Product Catalog Team" would have UI, logic, and data skills.
  • Full Lifecycle Ownership: The team owning a domain-centric Bounded Context is responsible for its development, deployment, and operation. True autonomy.
  • Domain-Specific Language: Each vertical, domain-aligned Bounded Context cultivates its own rich Ubiquitous Language.

S2: Boundary Blunders

Episode 3

The Swarm of Gnats!

When your “microservices” are just…
microscopic problems

A magnifying glass over a single gnat, above a swarm of gnats and a field of tiny buildings

Order placement workflow

Super-decomposed e-commerce platform

CreateOrderShellServiceValidateCustomerCreditServiceReserveInventoryItemServiceCheckProductAvailabilityServiceApplyDiscountCodeServiceValidateAddressServiceCalculateTaxServiceCalculateShippingFeesServiceProcessPaymentAttemptServiceConfirmOrderService

Note: other services are omitted for brevity

Can you spot it?

The “Atomized Order” fiasco

CreateOrderShellServiceValidateCustomerCreditServiceReserveInventoryItemServiceCheckProductAvailabilityServiceApplyDiscountCodeServiceValidateAddressServiceCalculateTaxServiceCalculateShippingFeesServiceProcessPaymentAttemptServiceConfirmOrderService
👩🏽New Dev
I need to understand the order placement flow. Where do I start?
Well, for a single order, it first hits CreateOrderShellService, then calls out to ValidateCustomerCreditService, which might call CustomerDetailsService, then it goes to CheckProductAvailabilityService, which pings ProductDetailsService and InventoryLedgerService... (continues listing several more tiny services)... It's about 15 tiny service hops for one order.
Senior Dev👨🏻‍🦱
🧑🏽‍🦳Ops Engineer
And when an order fails, good luck tracing it! Debugging across that chain of 15 services, each with its own logs and potential points of failure, is a nightmare. Our distributed tracing dashboard looks like a spiderweb.
We need to add a simple 'loyalty points earned' calculation during checkout. How long will that take?
Product Owner👧🏻
👨🏻‍🦱Senior Dev
Well, we need to decide which of the 15 services should own it, or maybe it's a new 16th service? Then we need to plumb it into the call chain, handle potential failures... it's surprisingly complex to add anything.

Lost in the Noise!

When bounded contexts are too granular & chatty!

CreateOrderShellServiceValidateCustomerCreditServiceReserveInventoryItemServiceCheckProductAvailabilityServiceApplyDiscountCodeServiceValidateAddressServiceCalculateTaxServiceCalculateShippingFeesServiceProcessPaymentAttemptServiceConfirmOrderService

The Problem

Bounded Contexts (and the microservices implementing them) are defined too granularly ("nanoservices"). Cohesive business logic that belongs together is split across too many tiny, interdependent pieces.

So What?

🐌

Chattiness & Latency

Many network hops for a single business operation drastically increase response times and points of failure.

⚙️⚙️

Distributed Monolith

Despite being separate services, they are so tightly coupled through synchronous calls that a failure in one often cascades, bringing down the whole process. They can't be deployed or changed independently in practice.

🔥🖥️

Operational Complexity

Managing, deploying, monitoring, and debugging hundreds or thousands of tiny services is an immense operational burden (Sara's nightmare).

⛓️‍💥

Loss of Business Cohesion

A single business concept (like an "Order" or a "Product") becomes fragmented, making it hard to understand or change holistically.

The Fix?

Find the right “altitude” – cohesive, not microscopic, contexts!

OrderTakingContext

  • ValidateOrder
  • ApplyDiscounts
  • CalculateInitialTaxEstimate

PaymentProcessing

InventoryManagement

How we can do better

  • Focus on Business Capabilities: Group closely related business behaviors and data together. A Bounded Context should represent a significant, cohesive piece of the domain.
  • Transaction Boundaries Matter: Often, operations that need to be ACID (Atomic, Consistent, Isolated, Durable) or at least strongly consistent should live within a single Bounded Context (and often a single service).
  • High Cohesion, Low Coupling: Maximize cohesion within a Bounded Context; minimize coupling between Bounded Contexts. Don't split things that naturally belong together just for the sake of “smallness”.
  • Consider the "Why" of Microservices: Remember the goals (independent deployability, scalability, team autonomy). Are your tiny services actually achieving these, or just adding overhead?
  • Start Larger, Decompose if Necessary: It's often easier to break down a slightly larger, cohesive service later if clear seams emerge than to glue a swarm of nanoservices back together.
  • Listen to the Domain Language: If your business experts talk about "Order Placement" as a unified concept with several steps, your primary Bounded Context might reflect that, rather than atomizing each step.

S2: Boundary Blunders

Episode 4

Core Confusion

Is your secret sauce
drowning in the generic soup?

A frazzled chef grates cheese over burgers while a sauce spills on the kitchen floor

Can you spot it?

The “Customer Success Hub” overreach

👩🏽CEO
Our Churn Prediction Engine is our #1 strategic asset! We need to iterate on its AI model daily to stay ahead!
We're trying, Angela, but the CustomerSuccessHub also manages all the 'Helpful Tip' email campaigns. Marketing just requested a major redesign of all email templates, and that's a huge chunk of work for the team this sprint because it's the same service.
Lead Dev👨🏻‍🦱
🧑🏽‍🦳Data Scientist
And the Churn Prediction Engine really needs dedicated GPU resources and a specialized data pipeline. But the CustomerSuccessHub runs on general-purpose servers optimized for the web traffic of the Onboarding Wizard and Feedback Forms.
I was assigned to enhance the Knowledge Base Integration sync logic. It's taking a while because the CustomerSuccessHub codebase is so large, and I have to be careful not to break anything related to the Churn Engine by mistake.
Junior Dev👧🏻
Customer Success Hub
Core domain chart
GenericSupportingCore12345

Customer Success Hub

Core domain chart

GenericSupportingCore12345

High

Complexity

Low

Low

Business Differentiation

High

  1. Onboarding Wizard
  2. Automated ‘Helpful Tip’ Email Dispatcher
  3. Knowledge Base Integration
  4. User Feedback Collection Forms
  5. Proactive Churn Prediction Engine

Lost in the Mix!

When your core domain gets treated like common ground.

GenericSupportingCore12345

The Problem

The "CustomerSuccessHub" Bounded Context ignores subdomain cohesion. It lumps a strategically critical Core Domain (the Churn Prediction Engine) with routine Supporting (Onboarding, Feedback Forms) and low-value Generic (KB Sync, Tip Emails) subdomains, treating them all as equals.

So What?

Core Domain Neglect

The unique Churn Prediction Engine doesn't receive the specialized focus, talent, investment, or infrastructure it desperately needs to excel.

Innovation Stagnation

Critical enhancements to the Core are delayed or deprioritized due to the urgent (but less strategically important) needs of Generic/Supporting features.

Technical Compromises

The Core Domain is often forced to conform to the lowest common denominator in terms of technology, architecture, and deployment practices suitable for the more generic parts.

Talent Misallocation

Top engineering and data science talent may be diverted to maintaining less critical functionalities, leading to frustration and underutilization of skills.

The Fix?

Cherish your core, strategically separate the rest!

CustomerSuccessHub

CustomerSupportTools

U

D

ACL

ChurnPredictionEngine

OHS

U

D

EngagementComms

How we can do better

  • Identify & Classify Subdomains: Rigorously map your business landscape into Core, Supporting, and Generic subdomains. This is a strategic exercise!
  • Isolate and Elevate Your Core: Create dedicated Bounded Context(s) for your Core Domain(s). This is where you innovate and win.
  • Tailor Treatment:
    • Core Contexts: Highest-quality design, best engineering talent, custom-fit solutions, dedicated resources, modern tech if needed. Protect them fiercely.
    • Supporting Contexts: Build robustly and cost-effectively. Custom if necessary, but avoid over-engineering.
    • Generic Contexts: Aggressively seek to buy off-the-shelf solutions or outsource. Integrate via thin, dedicated Bounded Contexts if needed.
  • Conscious Coupling: Design integrations so that Supporting and Generic contexts serve the Core, not the other way around. The Core should not be held hostage by generic components.
  • Align Organization & Investment: Your team structures, budget allocations, and strategic roadmap must reflect the primacy of the Core Domain.

S3: Exposed & Entangled

Episode 1

The Tangled Datastore Trap

When sharing data
means sharing headaches

Two boxes labelled BOUNDED CONTEXT SERVICE pull cables tangled around one shared database

Can you spot it?

The “One Big Database” story

ShippingLogistics
CustomerBilling
👩🏽Logistics
Team Dev
We need to add a 'PreferredDeliveryTimezone' column to the Addresses table for our ShippingLogisticsContext to improve delivery scheduling.
Hold on! Our CustomerBillingContext reads the Addresses table for invoicing. If you add a nullable column, our existing address validation logic might throw errors, or worse, silently fail if the ORM gets confused. We need to test that extensively.
Billing
Team Dev
👨🏻‍🦱
🧑🏽‍🦳Logistics
Team Lead
But we need this for the Q3 peak season! We can't wait for Billing's test cycle.
And remember, any change to Addresses requires downtime for schema migration, affecting both systems. Plus, the Shipments table is already huge and under heavy load from both contexts. Performance is a constant worry.
DBA👧🏻

Lost in the rows & relations!

Shared database: the ultimate hidden monolith

ShippingLogistics
CustomerBilling

The Problem

Different bounded contexts are directly coupled through a shared database schema. This makes the database a central point of contention and a hidden dependency integrator.

So What?

Change Paralysis

Fear of breaking another context stifles schema evolution. One team's progress is hostage to another's

Coordinated Deployment Hell

Database changes often require all dependent services to be deployed simultaneously, negating independent deployability.

Unintended Side Effects

A change made for one context can unknowingly break functionality or performance in another.

Performance Interference

Heavy load or inefficient queries from one context can cripple others sharing the database.

The Fix?

Data sovereignty – each context captains its own ship!

ShippingLogistics
CustomerBilling

❌

ShippingLogistics
CustomerBilling

How we can do better

  • One Context, One Database: Each Bounded Context MUST have exclusive ownership and control over its own database schema and data.
  • APIs as Data Contracts: If Context A needs data from Context B, it makes a request through Context B's well-defined and versioned API. Context B is the sole guardian of its data.
  • Embrace Eventual Consistency via Events: For data that needs to be shared or replicated, Context B can publish domain events (e.g., AddressUpdatedEvent, ShipmentCreatedEvent). Subscribing contexts can maintain their own local read-models.
  • Strategic Data Replication (Read-Only Copies): It's acceptable for a context to store a local, read-only copy of data from another context for resilience or query performance, as long as it's clear that this is a replica updated via events/APIs.
  • No Shared Tables, Ever: This is the golden rule. Not even read-only access to another context's tables.
  • Refactor Gradually: For legacy systems, start by creating views or API facades over shared tables as an intermediate step. Then, methodically migrate tables to new, dedicated databases for each context (Strangler Fig for databases).

S3: Exposed & Entangled

Episode 2

The Open Kimono Context

When your internals
aren't so private anymore!

Figures in orange jumpsuits pull open a robe hung from the ceiling, spilling its contents on the floor

Can you spot it?

The “Tell-All” API

InventoryContext

Java code for InventoryContext. InventoryItem keeps a list of recentStockEvents. InventoryHandler returns the whole InventoryItem aggregate in the API response, with the comment: exposes internals.

OrderProcessingContext

Java code for OrderProcessingContext. InventoryClient fetches InventoryItem from the inventory service. OrderHandler reads item.recentStockEvents directly, with the comments: misuse, bypass aggregate methods, and should not access this directly.

Can you spot it?

The “Tell-All” API

InventoryContext

OrderProcessingContext

👩🏽Inventory Dev
Team, I've found a much better way to represent recentStockEvents internally – using a new compressed format. It'll improve our performance significantly! I'm refactoring the InventoryItem class.
Hold everything, Irina! Our OrderProcessingContext directly reads the recentStockEvents list from the InventoryItem object your API returns. If you change that structure, our order validation logic will completely break!
Order Dev👨🏻‍🦱
👩🏽Inventory Dev
But that list and its format are internal to how we calculate stock! You should just be calling calculateAvailableStock() if you need that.
Irina, your API is handing over the keys to the entire InventoryItem kingdom, raw and unfiltered. Omar's team is simply using the detailed map you provided. Your internal refactoring is now an external breaking change.
Architect👧🏻

Lost in the guts!

Exposing internal models: coupling by indecent exposure!

Java code: the InventoryItem class with a public List of StockMovementEvent called recentStockEvents, a public Money wholesaleCost, and a calculateAvailableStock method

Don’t leave your kimono open!

The Problem

The InventoryContext (Provider) exposes its rich, internal domain model (InventoryItem Aggregate) directly through its API, rather than a dedicated, stable Data Transfer Object (DTO). Consumers become tightly coupled to these private implementation details.

So What?

Provider Can't Evolve

The Inventory team is paralyzed. They can't refactor or improve their internal InventoryItem model without breaking the Order Processing team

Violates Encapsulation

The fundamental OO principle of hiding implementation details is broken. The provider's "insides" are public knowledge.

Coupled to Implementation

Order Processing now depends on things like the exact naming and structure of recentStockEvents, which it should never have known about.

Brittle Integrations

A small, internal change in Inventory can cascade and break Order Processing.

The Fix?

Speak through stable public interfaces!

The InventoryItem class, with its internal state
Java code: public record InventoryItemDTO with itemId, productName, availableStock and unitPrice

How we can do better

  • Define explicit contracts: For any data crossing context boundaries (API requests/responses, events), use dedicated DTOs. These are simple data structures, not rich domain objects.
  • Map Internals to contracts (and vice-versa): The Bounded Context is responsible for mapping its internal domain objects to DTOs before sending, and mapping incoming DTOs to commands or internal objects. This is the "translation" layer.
  • Embrace Eventual Consistency via Events: For data that needs to be shared or replicated, Context B can publish domain events (e.g., AddressUpdatedEvent, ShipmentCreatedEvent). Subscribing contexts can maintain their own local read-models.
  • DTOs are the Contract: The structure of your DTOs forms the stable, public contract. They should only expose what consumers need to know, in the simplest way possible.
  • Hide Your Rich Model: Your internal Aggregates and Entities, with all their complex logic and private state, remain hidden behind your context's boundary. They are free to evolve.
  • Focus on Intent, Not Implementation: DTOs should communicate the intent and state relevant to others, not the nitty-gritty of how that state is derived or managed internally.
  • Consider Consumer Needs (but don't be dictated by them for your internals): Design DTOs to be useful, but always protect your internal model's integrity and freedom to change.

S3: Exposed & Entangled

Episode 3

The synchronous quicksand

When real-time calls
create real-time system failures

A long line of dominoes falling into a spiral pit

Can you spot it?

The “House of Cards” architecture

Sequence diagram. The user submits the sign-up form to RegistrationService. In a synchronous cascade, RegistrationService calls UserService, which calls WelcomePackageService, which calls DocumentService. Each reply comes back in turn: DocsReady, PackageReady, AccountCreated, Registration complete.

Can you spot it?

The “House of Cards” architecture

The same sequence diagram, but DocumentService times out. The timeout travels back up the chain: WelcomePackageService, UserService and RegistrationService each time out, and the user sees a timeout.

Can you spot it?

The synchronous cascade catastrophe

👩🏽New User
Okay, I've hit 'Sign Up'! The spinner is going... hope this doesn't take too long to confirm my registration and get my welcome documents.
So, when Sarah registers, our RegistrationService starts a sequence. It synchronously calls UserService to create the account. If that's okay, UserService then synchronously calls WelcomePackageService. That service, in turn, synchronously calls DocumentService to generate personalized docs. (Pointing to the successful flow diagram). If every service in this chain responds promptly, like this, Sarah gets 'Registration Complete!'
Lead Dev🧑🏻‍🦰
👨🏻‍🦱Junior Dev
That's a lot of direct waiting. What if DocumentService has a problem, like it did in staging yesterday? It timed out, and the whole registration seemed to fail even though the user account was probably made...
You're right, Chloe. If DocumentService times out, as shown here, that timeout error ripples all the way back. WelcomePackageService fails because it was waiting. Then UserService has an issue, and ultimately RegistrationService has to report a failure to Sarah, even if her core user account was created before DocumentService choked.
Lead Dev🧑🏻‍🦰

Lost in the waiting game!

The distributed monolith: separate services, shared (and brittle) fate!

The Problem

Services are chained together through deep, synchronous, blocking calls. A failure or significant slowdown in any single service within the chain directly impacts all upstream services, creating a brittle, monolithic failure behavior.

So What?

Cascading Failures

A problem in a single component brings down the entire registration flow. One service's hiccup becomes everyone's outage.

Reduced System Availability

The overall success of registration isn't just dependent on RegistrationService; it's RegistrationService AND several others all being up and fast, simultaneously.

Poor User Experience

The user either waits excessively or gets a confusing failure message, potentially after some parts of the process (like account creation) have already succeeded.

Risk of Data Inconsistency

If UserService creates an account but DocumentService fails, is the user half-registered? Complex rollback logic across services is needed but rarely perfect.

The Fix?

Break the chains with asynchronous events & flows!

Sequence diagram with an EventBus. RegistrationService calls UserService synchronously to create the account, then answers the user at once: account created, welcome package in progress. It publishes UserAccountCreatedEvent. WelcomePackageService picks up the event, sets up the package and asks DocumentService for the documents. A note says this may fail, and the service then retries or marks the package as pending.

The Fix?

Break the chains with asynchronous events & flows!

How we can do better

  • Identify the Core Transaction: What is the absolute minimum that must succeed synchronously for the user to get value? (e.g., account creation itself).
  • Decouple Secondary Actions Asynchronously: Tasks like generating welcome documents or sending emails are perfect candidates for asynchronous, event-driven processing.
  • Publish Domain Events: When the core transaction is done (e.g., UserAccountCreatedEvent), publish an event.
  • Subscribing Services React Independently: WelcomePackageService and DocumentService can react to these events at their own pace, with their own retry logic.
  • Provide Immediate Feedback for the Core Action: Don't make the user wait for background tasks to complete.
  • Embrace Eventual Consistency: The welcome documents might not be ready the microsecond the account is created, and that's usually okay.
  • Protect Necessary Synchronous Calls: If some sync calls remain (like CreateUserAccount), ensure they are highly available and protected with timeouts, retries, and circuit breakers.

Is that it???

A tangled ball of coloured yarn The yarn as six straight, separate strands Book cover: Domain-Driven Design with Java, A Practitioner’s Guide, by Premanand Chandrasekaran and Karthik Krishnan
Book cover: Data Architecture, A Software Architect’s Guide to Building Data-Driven Systems, by Pramod Sadalage and Premanand Chandrasekaran, from O’Reilly

Summer 2026

← Talks