Quick revision
The short answer
A bounded context is a boundary inside which one model and its language are consistent, so a word like Customer has exactly one meaning there. In Sales a customer is a lead with contacts and opportunities, in Billing an account with payment methods and invoices, and in Support a requester with tickets and entitlements; forcing one shared Customer across all three makes it large and couples the teams, so each context keeps its own model and translates at the boundaries using a shared identifier. A bounded context is a model boundary, not a deployment unit: it can be a microservice, a module in a modular monolith or several services, and a context map documents how contexts relate, for example customer-supplier, conformist or anti-corruption layer.
What to remember
In this answer, we saw that a bounded context is a boundary within which one model and its language are consistent. Customer means a lead with contacts and opportunities in Sales, an account with payment methods and invoices in Billing, and a requester with tickets and entitlements in Support, so forcing one shared model would make it large and couple the teams. Each context keeps its own model and translates at the boundaries using a shared identifier. A bounded context can be a microservice, a module in a modular monolith or several services, since it is a model boundary rather than a deployment unit, and a context map documents relationships such as customer-supplier, conformist or anti-corruption layer.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A bounded context is a boundary inside which one model and its language are consistent, so a word like Customer has exactly one meaning there. In Sales a customer is a lead with contacts and opportunities, in Billing an account with payment methods and invoices, and in Support a requester with tickets and entitlements; forcing one shared Customer across all three makes it large and couples the teams, so each context keeps its own model and translates at the boundaries using a shared identifier. A bounded context is a model boundary, not a deployment unit: it can be a microservice, a module in a modular monolith or several services, and a context map documents how contexts relate, for example customer-supplier, conformist or anti-corruption layer.
Why this question is asked
Bounded contexts are the most important strategic idea in domain-driven design, and also the one most often confused with microservices. Getting them right decides whether a system can grow with several teams or ends up as one tangled model that everyone fears to change. Interviewers ask this question with the Customer example because it makes the abstract idea concrete. In this answer, we will define a bounded context, look at Customer in three parts of the business, see why one shared model fails, show how contexts translate at their boundaries, discuss how contexts map to services and modules, and introduce the context map.
1A Quick Recap: What Is a Bounded Context?
In DDD, we build a model of the business in code, and we name things in the ubiquitous language, the words the business experts and developers share. The trouble is that a large business does not have one language. The same word means different things to different groups, and each meaning is correct for that group.
A bounded context is the boundary within which one model, and one meaning of each word, applies consistently. Inside the Billing context, Customer has one definition, one set of rules and one class. Outside that boundary, other contexts are free to define Customer differently. The boundary is what makes it safe for both to be right.
2Customer in Sales, Billing and Support
Let us look at what Customer means in each of three parts of a software company. In Sales, a customer is often still a lead or prospect: a company with contacts, opportunities, a sales stage and a sales owner. It may not have signed anything yet. In Billing, a customer is an account: a legal entity with a billing address, a tax id, payment methods, a currency, subscriptions and invoices. Billing cannot work without a tax id. In Support, a customer is a requester: a person at a client with tickets, entitlements that say which products they may get help with, and a service level that sets response times.
These are not three views of the same record. They have different attributes, different rules and different lifecycles. A prospect can exist for months without ever becoming a billing account, and a support requester is a person, while a billing account is a company.
| Context | Customer means | Key data and rules |
|---|---|---|
| Sales | Lead or prospect | contacts, opportunities, stage, owner; no tax id needed |
| Billing | Billable account | legal entity, tax id, payment methods, invoices; tax id required |
| Support | Requester at a client | tickets, entitlements, service level; a person, not a company |
3Why One Shared Customer Fails
If we force one Customer class and table on all three, it must hold every attribute any of them needs, so most fields are optional for most uses. Rules contradict each other: Billing wants tax id to be mandatory, Sales needs to create customers without one. Every change needs agreement from all three teams, and a deploy of the shared model must be coordinated across them. The model ends up large, vague and owned by nobody, and the teams become coupled through it.
4Separate Models, Translated at the Boundaries
With bounded contexts, each one has its own model. To connect them, we share an identifier: when a deal is won in Sales, a CustomerWon event carries a customer id that Billing and Support store as well. Each context then translates the event into its own model.
Notice that Billing ignores the contacts and opportunities. It takes only the facts it needs, and its own rules, such as collecting a tax id before the first invoice, live in its own model. Sales can change how it tracks opportunities without Billing noticing.
5Contexts, Services and Modules
A bounded context is a model boundary, not a deployment unit. It is common to implement one bounded context as one microservice, and that is a good default when teams and scale justify it. But a context can just as well be a module in a modular monolith, a package structure with enforced boundaries, using tools such as Spring Modulith or ArchUnit. And a large context can be implemented by several services that share its model, for example a Billing API and a separate invoice-rendering worker.
The reason to keep the two ideas apart is that model boundaries and deployment boundaries change for different reasons. Model boundaries follow the business language; deployment boundaries follow scaling, team size and release needs. Starting with modules lets us test where the model boundaries really are before paying the cost of separate services.
- One context, one microservicecommon default for separate teams
- Several contexts as modules in one monolithSpring Modulith or ArchUnit enforce boundaries
- One context, several servicesshared model, split for scaling or workload
3 layers, from the top down. Step through them one at a time.
6The Context Map
Contexts do not live alone, so DDD uses a context map to document how they relate. In a customer-supplier relationship, the downstream context's needs are taken into account by the upstream team, which plans changes with it; Billing may be a customer of Sales in this sense. In a conformist relationship, the downstream context simply adopts the upstream model as it is, which is cheap but couples it, and is common with large external platforms. With an anti-corruption layer, the downstream context translates the upstream model into its own through a dedicated layer, protecting its model from the other's quirks. Other patterns include shared kernel, a small model two teams share, and open host service with a published language.
A context map is usually a simple diagram with these labels on the connections, kept next to the architecture documentation. Its value is that integration decisions become explicit, so teams know who must consult whom before changing a contract.
7Follow-up questions
How big should a bounded context be?
Big enough to hold a consistent model of one business capability, small enough that one team can own it. If two groups in the same context keep arguing about what a word means, it may be two contexts. If every change touches two contexts together, they may belong together.
Is a bounded context the same as a subdomain?
No. A subdomain is part of the business problem, such as billing or support. A bounded context is part of the solution, a model boundary in the software. Ideally they line up one to one, but legacy systems often have one context spanning several subdomains.
Do contexts share a database?
Ideally each context owns its data, which may be separate schemas on the same server. Sharing tables across contexts quietly shares a model, which is exactly what bounded contexts try to avoid.
8Conclusion
In this answer, we saw that a bounded context is a boundary within which one model and its language are consistent. Customer means a lead with contacts and opportunities in Sales, an account with payment methods and invoices in Billing, and a requester with tickets and entitlements in Support, so forcing one shared model would make it large and couple the teams. Each context keeps its own model and translates at the boundaries using a shared identifier. A bounded context can be a microservice, a module in a modular monolith or several services, since it is a model boundary rather than a deployment unit, and a context map documents relationships such as customer-supplier, conformist or anti-corruption layer.
Open with
A bounded context is a boundary in the software inside which one model and one language are consistent, so every term has exactly one meaning there. Customer is the classic example.
Then, if they want more
In Sales a customer is a lead or prospect, a company with contacts, opportunities, a sales stage and an owner, often with nothing signed. In Billing it is an account, a legal entity with a tax id, payment methods, subscriptions and invoices, and a tax id is mandatory.
In Support it is a requester, often a person, with tickets, entitlements and a service level. If we force one Customer model on all three, it becomes huge and mostly optional, the rules contradict each other, and every change needs all three teams to agree and release together.
So each context keeps its own model, Prospect, BillingAccount, Requester, and they connect through a shared customer identifier and events like CustomerWon, which each context translates into its own model, taking only what it needs. Important for design: a bounded context is a model boundary, not a deployment unit.
It is often one microservice, but it can also be a module in a modular monolith with enforced boundaries, or several services sharing one model.
And to document how contexts relate, we use a context map with relationships like customer-supplier, where the upstream plans with the downstream, conformist, where the downstream just adopts the upstream model, or an anti-corruption layer, where the downstream translates to protect its model.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What is a bounded context? Explain how the word Customer can mean different things in...": https://scrivio-interview-library.netlify.app/java/domain-driven-design/ef9ffc6a15/