Video in progress

Two teams can't agree on a shared API contract and each demands its own option. How do you resolve it?

The orders team wants to add the customer's full profile to the OrderCreated event, because it's convenient for their consumers. The customers team objects: the profile is their domain, the fields change often, and personal data would spread to every topic.

I find the real constraints of both sides (load, deadlines, customers), propose an option based on shared principles (versioning, backward compatibility, ownership), and turn the contract into an artifact with a single owner that is checked automatically.

📖 Answer

Both sides are right here from their own point of view. So I move from "who is right" to "by which principle do we decide".

The analysis:

  • Ownership. The customer profile belongs to the customers domain. Copying it into another event creates two sources of truth for the data, and is also risky from the standpoint of GDPR and personal data law.
  • The consumer's need. What do the orders team's consumers actually use from the profile? Often it's 2-3 fields: customer ID, segment, language.
  • The cost of change. If the profile schema changes, the OrderCreated version will have to change too, and the two teams end up coupled.

The compromise I'd propose:

  • OrderCreated carries only customerId and a few stable, non-personal fields.
  • Consumers that need the full profile fetch it from the customers service, or build their own local copy from the CustomerUpdated event the customers team publishes.

Then the systemic part, so this argument doesn't happen next time:

  • Contracts in a schema registry (Avro/Protobuf) or in OpenAPI, with a clear owner.
  • A backward compatibility check automatically in CI.
  • Consumer-driven contract tests (for example, Pact or Spring Cloud Contract), where the consumer formally states its needs.
  • A short shared guideline on event design: when to carry full data (event-carried state), and when only the ID.

If there's still no agreement, the decision is taken by the domain architect or by the shared manager of both teams, but the analysis goes before them in written form.