ADR-BW-017: Gate independent evolution on contract compatibility
Prefer compatible contract changes and coordinate breaking migrations using consumer-impact review and the existing schema and contract checks.
| Field | Value |
|---|---|
| Status | Proposed |
| Date | 2026-11-07 |
| Owners | Architecture Enabling TeamTeamArchitecture Enabling TeamEnabling team facilitating BookWorm's architecture governance, ADRs, arc42 documentation, engineering standards, testing...Open docs |
| Affected Resources | BookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs |
| Related ADRs | ADR-BW-004: Integrate request-response operations through owned HTTP and gRPC contractsDecision Recordv1.0.0ADR-BW-004: Integrate request-response operations through owned HTTP and gRPC contractsUse service-owned HTTP APIs and defined Protocol Buffer interfaces rather than internal handlers or database access.Ownerarchitecture-enabling-teamOpen docs, ADR-BW-010: Preserve message identity and cross-boundary correlationDecision Recordv1.0.0ADR-BW-010: Preserve message identity and cross-boundary correlationCarry stable integration identity and request context for routing and diagnosis without using correlation fields as auth...Ownerplatform-engineering-teamOpen docs, ADR-BW-016: Verify behavior, contracts, and boundaries in separate layersDecision Recordv1.0.0ADR-BW-016: Verify behavior, contracts, and boundaries in separate layersCombine focused business tests, consumer/provider contracts, architecture checks, schema validation, and high-value user...Ownerarchitecture-enabling-teamOpen docs |
Context & Problem Statement
Independent service deployments break when a publisher removes fields, renames topics, or alters semantic meaning in HTTP, gRPC, or Kafka contracts without coordinating with consumers. BookWorm needs clear evolution rules so routine additive changes ship independently while breaking changes follow a controlled migration.
Decision Drivers
- Rolling-upgrade safety: Keep producers and consumers compatible during staggered deployments.
- Independent velocity: Ship additive contract improvements without lockstep releases.
- Semantic integrity: Protect business meaning and topic routing, not just wire syntax.
Options Considered
| Option | Pros | Cons |
|---|---|---|
| Backward-compatible evolution + impact review for breaking changes | Safe independent deploys; clear versioning path | Automated checks cannot catch every semantic shift |
| Unrestricted publisher changes | Fast for single-team iteration | Breaks downstream consumers and customer journeys |
| Overwrite contract baselines before testing | Checks pass immediately | Defeats the safety net of contract testing |
| Lockstep releases across all services | Versions always match | Eliminates independent deployability; high rollout risk |
Decision & Consequences
Chosen Option: Require backward-compatible (additive, optional) evolution for existing HTTP, gRPC, and Kafka contracts, gated by consumer-impact review and automated contract/schema checks. Unavoidable breaking changes must introduce a new API version or topic and coordinate consumer migration.
- Positive: Services deploy independently without breaking active consumers.
- Negative: Breaking migrations require dual-support periods and explicit deprecation.
Compliance Criteria
- Existing required fields, enum values, or topic names must not be removed or renamed in place.
- Contract changes must be reflected in OpenAPI/Protobuf/JSON schemas and verified against consumer contract tests.
- Breaking HTTP changes must increment the explicit API version (e.g.,
v1tov2).