What is a bounded context, and why isn't it the same as a microservice?

A bounded context is a boundary inside which a model and its vocabulary have exactly one meaning. Take "order": in a sales context it is a priced basket a customer can still change. In fulfillment it is a set of picked items with a shipping address and a weight. Each meaning is valid, but one shared Order class that tries to serve both ends up full of optional fields, ambiguous states and conditional logic. Domain-driven design draws a line between the two models, and each side keeps its own definition.

A bounded context is about meaning. It is not a deployment unit, a schema or an org-chart box, though it often shapes all three:

Concept What it bounds Relationship to a bounded context
Bounded context Meaning of a model and its terms The reference boundary
Microservice A deployable, independently running process One context may be split into several services; avoid one service spanning several contexts
Database schema Persisted data structures Usually private to one context, so its model can change without coordinating with others
Team People and decision rights Ideally owns one or more whole contexts, never half of one

Domain-driven design uses contexts to set service boundaries because a boundary drawn around meaning tends to stay stable. A context changes when the business language changes, not each time traffic or deployment needs shift.

Backend and platform engineers should care because ownership lines follow these boundaries. If a service boundary cuts through a context, two teams must coordinate every change to a shared model. That coordination is what microservices were supposed to remove.

Who should use event storming to find bounded contexts?

Event storming is useful for anyone who has to decide where one model ends and another begins, and who cannot make that call alone:

  • Architects and tech leads planning a new system or the decomposition of a monolith. They need boundaries that reflect the business, not the current code layout.
  • Backend and platform engineers who will own the resulting services. They benefit from seeing which events and rules they will be responsible for, and which they will only consume.
  • Product owners and domain experts from operations, support, finance or logistics. They hold the knowledge the model depends on, and the session gives them a format that needs no technical background.
  • Engineering managers deciding team ownership. The wall shows where work naturally splits and where handoffs will occur.

It fits best in organizations where several teams touch the same domain and no single person understands the whole flow. A single developer building a small CRUD application, or one team that already owns its whole domain, gains little from it. That situation is covered in more detail below.

How does event storming work?

Event storming models a business process as a timeline of domain events: facts that happened, written in past tense on sticky notes, such as Order Placed or Payment Captured. Participants place them left to right on a long wall or a shared digital whiteboard. Everyone can read and add to the same model at once.

Events are the starting point for three reasons:

  1. Business people already think in them. A warehouse supervisor can say "the parcel was packed" without knowing anything about tables or APIs. This lets domain experts contribute directly instead of reviewing engineers' diagrams.
  2. They avoid premature data modeling. Starting from entities ("what fields does an order have?") pulls the discussion toward one shared schema. Starting from events keeps attention on behavior and on who cares about each fact.
  3. They expose disagreement. When two people place conflicting stickies or argue about a term, the wall records the conflict instead of letting it get smoothed over in conversation.

The technique is usually described at three levels of detail:

Level Scope Typical output
Big picture A whole business flow across departments Timeline, hotspots, candidate bounded contexts
Process level One process within a context Commands, actors, policies, read models and external systems linked to each event
Software design level One context, ready for implementation Aggregates, invariants and event contracts

For finding service boundaries, the big-picture level does most of the work, and the design level refines the result. Boundaries are not drawn up front. They appear as the group notices where vocabulary, actors, pace of change and invariants shift along the timeline. The rest of this article follows that sequence: run the session, read the boundaries off the wall, turn them into contracts and context maps, then validate them against real change history.

When should you use event storming to find service boundaries, and when should you avoid it?

A big-picture session pays off when the cost of getting boundaries wrong is high and nobody yet holds the full picture. Three situations fit. The first is a new system, where nothing exists to constrain the model. The second is a monolith you intend to split, because the session shows which modules change together for business reasons. The third is repeated cross-team friction, where every feature needs three teams and a shared release. That last case often points to boundaries drawn around technical layers instead of business capabilities.

Postpone it when you cannot get domain experts in the room. Without them, engineers describe the system they already know. The resulting "events" mirror existing tables and API calls, and you end up rediscovering the current architecture instead of the business's structure. Skip it when the domain is small and one team already owns it end to end, because the session costs more than it reveals. Also skip it when the legacy data layout cannot realistically be migrated soon. Boundaries you cannot enforce in storage become boundaries only on paper.

Approach Good fit Main risk
Big-picture event storming Broad, poorly shared understanding of the domain Wasted effort without domain experts
Domain storytelling Few, well-defined workflows told by experts Narrower scope; may miss cross-process events
Carving along tables or team lines Fast extraction under deadline pressure Freezes accidental structure into service contracts
Modular monolith Boundaries still uncertain; one deployable is acceptable Module rules erode without enforcement

A modular monolith is often the right interim step. It lets you test context boundaries before you pay network and deployment costs.

What are the alternatives to event storming for finding boundaries?

Event storming is one way to discover bounded contexts. Several other approaches answer the same question from different angles, and they combine well with it.

  • Domain storytelling. A domain expert tells a concrete scenario ("the clerk receives a return, checks the item, issues a credit note") while a moderator records it as a pictographic story of actors, work objects and activities. It works well for a small number of well-understood workflows. Because it follows one story at a time, it can miss events that connect different processes, which a big-picture timeline brings out.
  • Business capability mapping. This lists what the business does (pricing, invoicing, shipping) independently of how it does it, and arranges those capabilities hierarchically. Capabilities are stable and make reasonable first-cut boundaries. However, the map does not show the language conflicts or invariants that decide where a model actually splits.
  • Analysing change history in version control. Files and modules that are repeatedly committed together are coupled in practice, whatever the architecture diagram says. This is cheap and grounded in evidence, but it describes the system as built, accidental coupling included. It is most useful for validating or challenging boundaries found by other means.
  • Splitting along existing tables, modules or team lines. This is fast and needs no workshop. It also freezes whatever structure already exists into service contracts, which is the main risk listed in the table above.
  • Modular monolith first. Rather than choosing boundaries through modeling alone, you enforce module boundaries inside a single deployable and observe which ones hold under real change. This defers the decision without discovering boundaries itself, so it pairs naturally with any of the techniques above.

In practice, teams often run event storming to generate candidate contexts, use capability maps to sanity-check scope, and use change history to test whether the proposed boundaries match how the code actually evolves.

How do you prepare and run a big-picture event storming session?

Get the people who know how the business actually works into one room: domain experts from operations or support, the product owner, and the engineers who maintain the code paths involved. Without domain experts, engineers reconstruct the flow from their own code, which reproduces the boundaries you already have instead of revealing the ones you need.

Pick one end-to-end business flow, such as "customer places order through to refund", and set a hard timebox, typically a half day. A narrow scope with a fixed end keeps the wall readable and forces the group to prioritise.

Sticky Meaning Example
Domain event Something that happened, in past tense Payment Captured
Command Intent that triggers an event Capture Payment
Actor Person or role issuing a command Warehouse clerk
Policy "Whenever X, then Y" rule When stock reserved, request payment
External system Dependency outside your control Payment gateway
Hotspot Question, conflict or pain point "Who cancels after dispatch?"

Run it in four passes:

  1. Chaotic dump. Everyone writes events in silence and in parallel. This prevents the loudest person from shaping the model.
  2. Enforce the timeline. Order the events left to right and remove duplicates. Gaps and contradictions show up here.
  3. Mark hotspots. Record each disagreement on a sticky and move on. Do not resolve it in the room.
  4. Add commands, actors and policies to show what causes each event.

The main facilitation risk is stalling in terminology debates. When two groups use "order" to mean different things, that is evidence of a boundary, not a problem to settle. Write it down as a hotspot. Without a timebox and a named output, such as a hotspot list with owners, the session uses a lot of senior people's time and produces only a photo of a wall.

How do you spot bounded context boundaries on the event storming wall?

Once the timeline has settled, scan it for places where the language, the people, or the pace changes. Each of these suggests that a different model is in use on the other side.

  • The same word means different things. In sales, an "order" is a negotiable thing with prices and discounts. In fulfillment, it is a list of items to pick, pack, and ship. When people argue over what a sticky note means, that argument usually marks a boundary between two models, not a naming problem to fix.
  • The actor or department changes. If the people triggering commands change from account managers to warehouse staff, the rules, vocabulary, and decision makers usually change too.
  • Pivotal events hand off work. Events such as "Order Placed" or "Payment Confirmed" end one stage and start another. Teams on either side of them rarely need each other's internal details.
  • Rates of change differ. Pricing rules that change weekly should not share a model with shipping logic that has not changed in years. Coupling them forces the stable part to follow the volatile one.
  • Policies react asynchronously. A policy like "when payment confirmed, reserve stock" reacts to another area's event without needing its internals. That is a natural integration point.

Mark candidate seams with a vertical tape line or a distinct sticky color, and label each one with the signal that justified it. Treat every line as a hypothesis. It reflects what the people in the room understood that day, and later evidence should be able to move it.

How do you turn candidate contexts into service boundaries and event contracts?

Start inside each candidate context by finding the rules that must never be violated, even for a moment. "An order's total equals the sum of its lines" or "a payment can't be captured twice" are invariants. The cluster of state that enforces one invariant is an aggregate, and it must change in a single local transaction. If two stickies must always change together, they belong to the same aggregate, which means the same context.

Take a fictional order-to-delivery wall: CartCheckedOut, OrderPlaced, PaymentAuthorized, PaymentCaptured, StockReserved, PickListCreated, ParcelPacked, ShipmentDispatched, ParcelDelivered. These fall into Sales (orders), Payments (authorization and capture), Fulfillment (stock and picking) and Shipping (carriers and tracking). No invariant spans two of them, so they can communicate without shared transactions.

Between contexts, use only published events or explicit APIs, never shared tables. A contract such as OrderPlaced should carry an event ID, an order ID, an occurrence timestamp, a schema version, and only the fields consumers need. Consumers must be idempotent. They record each processed event ID in the same transaction as their state change and skip duplicates, because brokers redeliver messages.

The business has to sign off on these costs explicitly:

  • Eventual consistency. An order can show "placed" before payment is confirmed.
  • Ordering. Ordering is guaranteed per key at best, never globally.
  • Retries. Messages will be delivered more than once.

Don't deploy every context as its own service on day one. Premature splits tend to produce a distributed monolith: chatty synchronous calls, sagas used to work around distributed transactions, and duplicated data that someone must reconcile.

import json
import sqlite3

SAMPLE = json.dumps({
    "event_id": "7f3c2a9e-1b4d-4c8a-9e2f-0a1b2c3d4e5f",
    "event_type": "OrderPlaced",
    "schema_version": 1,
    "occurred_at": "2026-11-09T10:15:00Z",
    "order_id": "ord-1042",
    "lines": [{"sku": "SKU-RED-MUG", "qty": 2}],
})

def setup(db):
    # Fulfillment owns these tables; Sales never reads or writes them.
    db.execute("CREATE TABLE IF NOT EXISTS processed_events (event_id TEXT PRIMARY KEY)")
    db.execute("CREATE TABLE IF NOT EXISTS reservations (order_id TEXT, sku TEXT, qty INTEGER)")

def handle_order_placed(db, raw):
    event = json.loads(raw)
    if event["schema_version"] != 1:
        # Unknown contract version: fail loudly so it can be parked, rather than guessing.
        raise ValueError("unsupported schema_version")
    with db:  # one local transaction: the dedupe record and the state change commit or roll back together
        cur = db.execute(
            "INSERT OR IGNORE INTO processed_events (event_id) VALUES (?)", (event["event_id"],)
        )
        if cur.rowcount == 0:
            return "duplicate skipped"  # already handled; redelivery is a no-op
        for line in event["lines"]:
            db.execute(
                "INSERT INTO reservations VALUES (?, ?, ?)",
                (event["order_id"], line["sku"], line["qty"]),
            )
    return "processed"

db = sqlite3.connect(":memory:")
setup(db)
print(handle_order_placed(db, SAMPLE))  # processed
print(handle_order_placed(db, SAMPLE))  # simulated broker redelivery -> duplicate skipped

A Fulfillment consumer for a versioned OrderPlaced contract that records each event ID in the same local transaction as the stock reservation, so redelivered messages are skipped instead of reserving stock twice.

What does context mapping tell you about integration and team coordination?

Once the candidate contexts are stable, draw lines between them and label each line with a relationship pattern. In the worked example, Ordering is downstream of Catalog for product and price data. Payments and Fulfillment both consume Ordering's OrderPlaced event. Fulfillment depends on an external carrier API that it cannot influence. Each label states who adapts to whom, and that decides where integration code lives and which teams must coordinate releases.

Pattern Example link Integration code Release coupling Team coordination
Customer/supplier Catalog → Ordering Supplier builds what the customer needs Moderate; supplier plans around customer needs Shared planning and negotiated priorities
Conformist Ordering adopts Catalog's model as-is Minimal High; upstream changes break downstream Low effort, but downstream has no influence
Anticorruption layer Fulfillment → carrier API Translation layer owned by downstream Low Low; downstream absorbs upstream changes
Shared kernel Ordering and Payments share a money/currency model A shared library High; both must release together Continuous, with joint ownership
Published language OrderPlaced event schema Producer and consumers code against a documented schema Low while the schema stays backward compatible Mostly limited to schema change review

Shared kernels and conformist links cost little at first because nobody writes translation code. The cost arrives later. Every change to the shared model is a coordinated release, and that recreates the distributed monolith at the model level. An anticorruption layer keeps the downstream model independent, but the translation code needs tests and updates each time upstream changes. Reserve shared kernels for small, slow-moving concepts such as money. Use anticorruption layers where the upstream system changes on a schedule you don't control.

+-------------+
|   Catalog   |  upstream
+-------------+
       |
       | customer/supplier
       | (conformist if Ordering adopts Catalog's model as-is)
       v
+-------------+  shared kernel: money/currency  +-------------+
|  Ordering   |<===============================>|  Payments   |
+-------------+  (joint ownership, co-release)  +-------------+
       |                                               ^
       | published language: OrderPlaced event         |
       +-----------------------------------------------+
       |
       v
+-------------+
| Fulfillment |
+-------------+
       |
       | anticorruption layer (translation owned by Fulfillment)
       v
+-------------+
| Carrier API |  external; Fulfillment cannot influence it
+-------------+

Context map for the worked example. Each link is labeled with its relationship pattern, which shows who adapts to whom and which teams must coordinate releases.

How should you assign ownership and validate boundaries over time?

Map contexts to teams by cognitive load, not by service count. A team can own several contexts if together they fit in the team's head: the team knows the models, can carry the on-call load, and understands the change rate. Splitting low-churn contexts across thin teams creates handoffs with no autonomy gained. Split ownership when one team's backlog or pager is dominated by a single context.

Ownership option Fits when Main risk
One team, one context High churn, deep domain logic Team too small to staff on-call
One team, several contexts Related, low-churn contexts Contexts blur into one model
Several teams, one context Rarely justified Constant coordination inside the model

Conway's law cuts both ways. Aligning boundaries with teams reduces coordination. But the current org chart also shaped what people put on the wall. If a boundary matches a reporting line exactly, ask whether the domain produced it or the org did. Reorganizing costs handover time and lost context, so wait until the map holds steady.

Validate the map against history. Take recent change requests and incidents and record which contexts each one touched. Most should stay inside one.

Illustrative estimate (assumed numbers, not a benchmark): coordination hours = changes × cross-team share × teams per change × hours per team. Before: 40 × 0.6 × 3 × 4 = 288 h/quarter. After: 40 × 0.2 × 2 × 4 = 64 h/quarter.

Budget separately for legacy data migration, which usually takes far longer than the modeling. Revisit the map whenever the domain changes, such as a new product line, a regulation, or a recurring cross-context incident.

How OneEnv can help

Disclosure: OneEnv is the product behind this blog.

OneEnv (oneenv.io) is a workspace-based governance platform for the things services share — environment variables, database structure, API routes and validation rules. A change to a shared value is staged on a branch, reviewed once, and then every affected service explicitly approves or rejects it before it goes live, so you can see who a change touches before it ships instead of finding out in production.

Applied to event storming bounded contexts, this is where it helps:

Saves time

  • Every service that inherits a shared value is listed in one place, so nobody searches repos and chats to find out who is affected.
  • One review per branch replaces coordinating each team separately; each service still keeps its own approve/reject.
  • Reviewers see the exact diff and the list of affected services up front, so approval is a decision rather than an investigation.

Saves cost

  • Fewer production incidents and rollbacks caused by a shared value, route or column changing under a consumer unannounced.
  • Less duplicated configuration to maintain: one shared definition inherited by many services.
  • Per-service approve/reject means a bad shared value can be refused where it would break something, before it is live.
  • OneEnv has a free plan (1 workspace, unlimited services and members, full governance), so trying it costs nothing.

These are qualitative benefits, not measured results — how much you save depends on how many services share the value.

Want to try it? Start at oneenv.io.