When teams first encounter the term 'context boundary' in domain-driven design, two activities often emerge as essential yet confusingly similar: the Discovery Walk and the Handshake Protocol. Both help map where one bounded context ends and another begins, but they serve distinct purposes and answer different questions. This article from the Fablezz viewpoint clarifies the conceptual difference, provides practical workflows for each, and helps you decide which approach fits your current phase of work.
Why Context Boundaries Matter and Where Teams Get Stuck
Every software system of meaningful size eventually faces the challenge of defining where one logical domain ends and another begins. Without clear boundaries, teams experience frequent integration failures, duplicated logic, and endless debates about ownership. The core problem is that boundaries are not inherent in the problem domain—they are choices made by architects and developers based on a mix of business priorities, team structures, and technical constraints.
Common symptoms of poorly managed boundaries include: services that need to be deployed together because they share internal data structures, teams that cannot make independent decisions because their domain overlaps with another, and integration code that grows more complex with every release. Many practitioners report spending more than half their integration effort on fixing boundary mismatches that could have been prevented with better upfront analysis.
The Fablezz viewpoint emphasizes that boundary definition is not a one-time event. It is an ongoing practice that requires both exploration and formalization. This is where the Discovery Walk and Handshake Protocol come into play. They represent two complementary rhythms: discovery to understand what lies on each side of a potential boundary, and handshake to lock down the terms of interaction once the boundary is sufficiently understood.
When Boundaries Become Blurry
Blurry boundaries often arise when teams rush to implementation without first exploring the domain's natural seams. A Discovery Walk helps reveal those seams, while a Handshake Protocol ensures that once found, they remain stable and well-defined. Without both, teams risk either over-analyzing without committing or committing without understanding.
In practice, we have seen projects where a team spent months debating the exact shape of a boundary without ever talking to domain experts—a failure of discovery. Conversely, we have seen teams jump into integration contracts only to discover that the underlying domain model had shifted, making the contract obsolete—a failure of formalization. The key insight is that discovery and handshake are not sequential phases but parallel threads that inform each other.
Core Frameworks: Discovery Walk vs. Handshake Protocol
To understand the difference, we need to define each activity in terms of its purpose, inputs, outputs, and typical participants.
Discovery Walk: Exploring the Unknown
A Discovery Walk is an unstructured or semi-structured exploration of a domain area to identify potential bounded contexts, aggregate roots, and domain events. It is inspired by the 'walking the skeleton' technique but focuses on the domain rather than the code. The goal is to surface implicit knowledge held by domain experts and translate it into a shared understanding among team members.
Typical inputs for a Discovery Walk include: user stories or problem statements, existing documentation (if any), and access to one or more domain experts. The output is usually a set of sketches, event lists, or a rough context map that highlights candidate boundaries. Participants include the entire development team, a facilitator, and domain experts. The session can last from a few hours to a full day.
Handshake Protocol: Defining the Contract
A Handshake Protocol is a structured negotiation between two teams (or between a team and an external system) to define the exact interaction at a context boundary. It formalizes the data format, protocol, error handling, and ownership of shared concepts. Unlike the Discovery Walk, which is open-ended, the Handshake Protocol has a clear agenda and produces a concrete artifact: the integration contract.
Inputs include the candidate boundary identified during discovery, a list of required interactions, and constraints from both sides. Outputs include API specifications, event schemas, or shared kernel definitions. Participants are technical leads from each side, with domain experts available for clarification. The session typically results in a written agreement that both teams commit to.
Comparative Overview
| Aspect | Discovery Walk | Handshake Protocol |
|---|---|---|
| Purpose | Explore and understand | Define and commit |
| Participants | Whole team + domain experts | Technical leads + stakeholders |
| Output | Context map, event list | API spec, contract document |
| Duration | Hours to a day | One to three sessions |
| Risk of omission | Missing implicit rules | Overlooking non-functional needs |
Execution Workflows: How to Run Each Activity
Running a Discovery Walk requires careful preparation to avoid aimless discussion. We recommend the following step-by-step workflow.
Discovery Walk in Practice
Step 1: Assemble the team and a domain expert. The facilitator explains the goal: to map the domain events and identify natural boundaries. Step 2: Start with a concrete scenario—for example, 'a customer places an order'—and trace the domain events that follow. Write each event on a sticky note and place it on a timeline. Step 3: As events accumulate, look for clusters that share a consistent set of rules or invariants. Those clusters are candidate bounded contexts. Step 4: For each cluster, ask: 'Who owns this data? What decisions are made here?' If the answers point to different teams or external systems, you have found a boundary. Step 5: Document the rough context map and share it with stakeholders.
Common pitfalls include letting the discussion drift into technical implementation too early, and not challenging assumptions made by domain experts. A good facilitator keeps the focus on 'what happens' rather than 'how it happens.'
Handshake Protocol in Practice
Step 1: Both teams review the candidate boundary from the Discovery Walk and list the interactions that cross it. Step 2: For each interaction, define the data payload, trigger condition, and expected response. Use a lightweight format like OpenAPI or AsyncAPI to capture the contract. Step 3: Discuss error scenarios: what happens when data is missing, the service is down, or the request times out? Document those as part of the contract. Step 4: Agree on versioning strategy and ownership of the contract. Who can change it, and how are changes communicated? Step 5: Both teams sign off on the contract, and it becomes the reference for implementation.
A common mistake is to skip the error handling discussions, assuming that 'happy path' is enough. In practice, error handling often reveals deeper boundary mismatches, such as different interpretations of a domain concept.
Tools, Stack, and Maintenance Realities
While the Discovery Walk is tool-agnostic, a few aids can improve its effectiveness. Whiteboards, sticky notes, or digital collaboration tools like Miro or FigJam work well. The key is to keep the artifact live—update it as understanding deepens. For the Handshake Protocol, tooling becomes more important. API specification tools (Swagger Editor, Stoplight), event schema registries (Schema Registry, AsyncAPI), and contract testing tools (Pact, Spring Cloud Contract) help automate validation and prevent drift.
Maintenance of boundaries is an ongoing cost. A Discovery Walk may need to be repeated when new features or domain changes occur. The Handshake Protocol should be versioned and reviewed whenever one side of the boundary changes. Teams often underestimate the effort required to keep contracts in sync, especially when multiple boundaries are involved. We recommend scheduling regular boundary reviews—every quarter or after major releases—to ensure the contracts still reflect reality.
Economic Considerations
Investing in a thorough Discovery Walk early in a project can save significant rework later. Industry surveys suggest that boundary mismatches discovered late in the development cycle cost 10 to 100 times more to fix than those caught early. Similarly, a well-defined Handshake Protocol reduces integration testing time and prevents production incidents. However, over-engineering contracts for boundaries that rarely change can waste effort. The Fablezz viewpoint advises calibrating the formality of the handshake to the volatility of the boundary: stable boundaries need less ceremony, while evolving ones need more.
Growth Mechanics: Scaling Boundary Practices Across Teams
As organizations grow, the number of context boundaries increases, and so does the need for systematic practices. A single team might manage two or three boundaries, but a department with multiple teams could have dozens. Scaling the Discovery Walk and Handshake Protocol requires lightweight, repeatable formats.
Standardizing Discovery
Create a template for Discovery Walk sessions that includes a standard agenda, a list of questions to ask, and a format for output. This ensures consistency across teams and makes it easier to compare maps from different parts of the organization. We have seen organizations create a 'boundary map' that lives in a wiki and is updated after each discovery session. The map becomes a shared reference for architects and tech leads.
Automating Handshake Enforcement
For Handshake Protocols, automation is key. Use contract testing tools to verify that each service adheres to the agreed contract. This can be integrated into CI/CD pipelines so that violations are caught before deployment. Additionally, consider using event-driven architecture patterns where boundaries are defined by event schemas rather than direct API calls, which can reduce coupling and make contracts easier to evolve.
A common scaling challenge is that different teams may use different tools or formats for their contracts. Establishing organization-wide standards for contract format (e.g., all APIs must have an OpenAPI spec, all events must have an AsyncAPI spec) reduces friction when teams need to integrate across boundaries.
Risks, Pitfalls, and Mitigations
Even with good intentions, teams fall into traps that undermine both discovery and handshake activities.
Pitfall 1: Discovery Without Action
Some teams run Discovery Walks but never follow up with formal contracts. The result is a vague understanding that quickly degrades as team members forget details or leave. Mitigation: After every Discovery Walk, schedule at least one Handshake Protocol session for the most critical boundaries identified. Treat the walk as a trigger, not a deliverable.
Pitfall 2: Handshake Without Discovery
Other teams jump straight into writing contracts without exploring the domain. They may define a technically correct API that misses the business intent, leading to frequent changes. Mitigation: Never start a Handshake Protocol without a recent Discovery Walk for that boundary. If the domain is new, run discovery first.
Pitfall 3: Over-Formalizing Early Boundaries
In early-stage projects, boundaries are fluid. Spending weeks on a detailed contract for a boundary that may shift is wasteful. Mitigation: Use lightweight contracts (e.g., a shared document) for evolving boundaries, and only formalize once the domain stabilizes. The Handshake Protocol can be iterated.
Pitfall 4: Ignoring Non-Functional Requirements
Handshake Protocols often focus on functional data exchange but ignore performance, security, or reliability. This leads to integration issues in production. Mitigation: Include a non-functional requirements checklist in the Handshake Protocol template. Cover latency, throughput, authentication, and error rates.
Decision Checklist: When to Use Which
To help teams choose the right activity at the right time, we have compiled a decision checklist. Use it when planning a boundary exploration session.
Checklist for Discovery Walk
- Is the domain area new or poorly understood?
- Are there multiple domain experts with different perspectives?
- Do you need to identify potential bounded contexts?
- Is the team aligned on the problem but not on the solution?
- Are you in an early project phase (inception or elaboration)?
If you answered yes to most of these, a Discovery Walk is appropriate.
Checklist for Handshake Protocol
- Has a candidate boundary been identified?
- Do two or more teams need to agree on integration details?
- Is the domain stable enough that a contract will not change weekly?
- Do you need to enforce compatibility (e.g., for compliance or safety)?
- Are you about to start implementation of cross-boundary features?
If yes to most, schedule a Handshake Protocol.
Common Questions
Q: Can we combine both activities in one session? A: It is possible but risky. Discovery requires openness and exploration, while handshake requires precision and commitment. Trying to do both in one meeting often results in neither being done well. We recommend separate sessions.
Q: How often should we revisit a boundary? A: There is no fixed rule, but a good heuristic is to revisit after any major feature addition or organizational change. For stable boundaries, an annual review may suffice.
Q: Who should facilitate each activity? A: For Discovery Walks, a neutral facilitator (not a domain expert) helps keep the discussion on track. For Handshake Protocols, a technical lead from either side can facilitate, but it is helpful to have a mediator if tensions are high.
Synthesis and Next Actions
The Discovery Walk and Handshake Protocol are not competing techniques but complementary tools in the boundary context mapping toolkit. The former helps you discover what exists and what matters; the latter helps you commit to a shared understanding. By mastering both, your team can navigate context boundaries with clarity and confidence.
We recommend the following next actions for teams starting out: (1) Run a Discovery Walk for one of your current pain points—a boundary that has caused integration issues. (2) After the walk, identify the top three boundaries that need formalization. (3) For each, schedule a Handshake Protocol session with the owning teams. (4) Document both the context map and the contracts in a shared location accessible to all stakeholders. (5) Schedule a quarterly boundary review to keep the artifacts up to date.
Remember that boundary mapping is a practice, not a project. It requires ongoing attention and iteration. The Fablezz viewpoint encourages teams to invest in discovery early, formalize only when necessary, and always keep the human conversations at the center. Boundaries are ultimately about people—their understanding, their agreements, and their ability to collaborate effectively.
Comments (0)
Please sign in to post a comment.
Don't have an account? Create one
No comments yet. Be the first to comment!