Video in progress
How do you identify bounded context boundaries in a new large system?
I draw the boundaries by language and business process, not by technical layer: where one word starts to mean two different things is usually a boundary. Event storming, team structure and rate of change confirm the decision.
📖 Answer
A bounded context is an area where one model and one vocabulary work consistently. The most reliable signal for finding it is a split in the language.
Example: the word "customer"
- for the sales department it means a lead, a phone number, a manager;
- for billing it means an account number, a plan, a debt;
- for delivery it means an address and the recipient's name.
If you cram all of it into one Customer class, you get an object with 60 fields that nobody fully understands. Three contexts means three small models, linked by a shared ID.
Here is how I do it in practice:
- Event storming with business representatives: we put the domain events ("Order placed", "Payment refunded") on a timeline. Groups of events that cluster densely and talk among themselves are context candidates.
- Checking the language. For each group we write down the key terms; if one term is defined differently in two places, that's a boundary.
- Reasons for change. Which rules change together? If plan rules change quarterly and delivery rules weekly, they are separate.
- Teams. It's good when one team owns one context; if two teams edit one model, the coordination cost grows.
- Transactional consistency. Data that must be strictly correct at the same moment should stay inside one context.
Mistakes: splitting contexts by table ("users service", "orders service"), or making them microservices from day one. Try the boundary inside a modular monolith first: moving it is as cheap as moving a package, not as expensive as moving a service.
Sign up to mark studied questions and save your progress.