{"canonical_url":"https://engineer.company/glossary/bounded-context/","content_markdown":"# Bounded context\n\n## What it is\n\nA bounded context is an explicit boundary within which a particular model and\nits language have a consistent meaning. A product can use the word account for\nboth access permissions and billing. For access, an account might be the\nidentity that can sign in. For billing, it might be a relationship that can own\ninvoices and charges. A bounded context tells a team which rules and vocabulary\napply when it uses the term.\n\nThe boundary is about meaning and ownership. It can be implemented as a module\nwithin one application, as a complete service or as an agreement around a set of\nprocesses. Its shape follows the product decisions that need to be made\nconsistently and the groups that own them. A deployment topology can reflect\nthose decisions, but the meaning of the model has to be understood first.\n\nContexts can share identifiers and exchange information. The exchange benefits\nfrom an explicit contract. A billing model might receive an identifier that\nconnects a payer with an access account and store only the details it needs for\nbilling. It can give that relationship a narrower meaning than the identity\nprovider uses. Making these translations visible helps preserve the vocabulary\nand rules inside each context.\n\n## Why it matters\n\nA team can use the same nouns in several parts of a product and still be talking\nabout different decisions. An order can be complete for a warehouse once it is\nshipped. A finance team could consider it complete only after payment settles. A\nsupport application might keep it open until a return period ends. If the whole\nsystem shares one general status field, each reader needs hidden knowledge to\ninterpret what the value means.\n\nA defined boundary also helps an organisation choose who can change a rule. The\nwarehouse team can decide how shipment states behave. Finance can use the facts\nit needs without adopting the entire warehouse model. A contract between them\nshould describe the facts being exchanged and where consumers find their own\ntruth. This gives changes a route for review and makes reused words less likely\nto spread incompatible assumptions.\n\nThe separation has a cost. Contexts need translations, ownership and ways to\ndiscover how they relate. If every operation crosses several boundaries just to\ncomplete one decision, the division may need review. Start with a difference in\nmeaning or responsibility that people can explain. Use boundaries where they\nclarify actual decisions and test the exchange where a user depends on both\nsides.\n\n## What it looks like in practice\n\nImagine a public directory of companies and a separate model of who can manage\ntheir records. The directory describes published entries and their visible\ninformation. The authority model describes a relationship between an\nauthenticated user and an organisation. Someone can report a factual error in\nthe directory while still lacking authority to edit the record directly. Keeping\nthose meanings clear helps define the submission and approval workflow.\n\nEngineer's\n[company ownership and adjudication case study](/portfolio/built-company-ownership-claims-and-adjudication/)\ndocuments a claim with evidence, an administrative approval step and an update\nto the authorisation graph after approval. Those are concrete decisions with\ndistinct responsibilities. The illustrative model uses one context for what is\nvisible in the directory and another for what a user is allowed to change. Give\neach context an explicit definition of an approved relationship. The integration\ncan then translate that decision for the directory and for permissions.\n\nTest the contract between the models. An approved claim may allow editing\nimmediately. A rejected claim can carry an explanation while leaving the\nauthority model unchanged. An update to the company name should preserve the\nrelationship to the organisation unless an intentional change to authority\naccompanies it. Capture the identifiers, status transitions and timing each side\nrelies on.\n\nTry one change in each direction. If publication changes the display format,\nconsumers of the authority decision should still recognise the relevant\norganisation. If the rules of approval change, the directory should still know\nwhich result it has to enforce. A test that combines both changes can expose\naccidental shared assumptions in names or identifiers.\n\n## Where it goes wrong\n\nNaming packages after business areas is an easy first step and can bring a false\nsense of precision. Check which part owns the decisions people make. If a client\ncalls several unrelated modules to interpret one status, the contract may be\nincomplete. Measure how often changes about one concept force edits across\nseveral parts of the system.\n\nBe cautious about duplicating rules in an integration adapter. Translating an\nidentifier or converting a published state can be useful. Reimplementing the\ndecision that granted authority can create another source of truth. Test the\npublished contract with a known decision and check what the receiving system\nactually does. Record any delay between the decisions and how users see it.\n\nOwnership can also be unclear during recovery. Suppose a replay delivers an old\napproval after authority has already been revoked. The context that owns\nauthority should apply its own transition and ordering rules, and a receiving\nsystem can check the version of the published state. The published directory's\nmodel of an edit request needs a way to report an access decision without\ntreating the earlier approval as permanent. Write the recovery example where\nboth teams can test it.\n\nFinally, review boundaries as the product changes. A new feature might give a\nformerly shared word an additional purpose. Talk through examples with the\npeople who make the relevant decisions, then update the contract and tests. A\nbounded context is useful when its definition helps one team explain its own\nmodel and helps another use the information it needs without guessing about the\nrest.\n\n## Further reading\n\n- [Microsoft Azure domain analysis for microservices](https://learn.microsoft.com/en-us/azure/architecture/microservices/model/domain-analysis).\n  Explains models, subdomains and bounded contexts.\n- [Microsoft .NET domain model boundaries](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/identify-microservice-domain-model-boundaries).\n  Discusses shaping application boundaries around business rules.\n- [Microsoft Azure tactical domain-driven design](https://learn.microsoft.com/en-us/azure/architecture/microservices/model/tactical-ddd).\n  Describes concepts used inside a model.\n\n\u003chttps://engineer.company/glossary/bounded-context/\u003e\n","date_modified":"2026-11-25T07:18:46Z","description":"Use different meanings of completed in payments and fulfilment to identify a boundary and model its integration.","formats":{"gemtext":"https://engineer.company/glossary/bounded-context/index.gmi","gopher":"https://engineer.company/glossary/bounded-context/gophermap","html":"https://engineer.company/glossary/bounded-context/","json":"https://engineer.company/glossary/bounded-context/index.json","markdown":"https://engineer.company/glossary/bounded-context/index.md","pdf":"https://engineer.company/glossary/bounded-context/index.pdf"},"kind":"page","language":"en","title":"What is a bounded context?","url":"https://engineer.company/glossary/bounded-context/","version":1}