advanced

Versioning

Evolve API and message contracts with additive changes, deprecation windows, compatibility tests, and explicit consumer migration.

Independent deployment requires evolving contracts without breaking consumers. Version via URL path, header, or schema registry subject; prefer additive changes and deprecation windows. Message schemas need forward and backward compatibility rules.

Trade-off: supporting multiple versions increases maintenance; aggressive breaking changes force lockstep releases.

On interviews: plan adding a required field to an event consumed by three teams; deprecation timeline.

Common pitfalls: breaking JSON without version bump; removing fields consumers still read; no consumer-driven contract tests.

Checklist:

  • Document compatibility policy per API and topic.
  • Prefer additive schema changes.
  • Run contract tests in CI.
  • Sunset old versions with metrics on usage.