Interview Prep/Real-World Interview/Deployments and releases

You need to ship a release that changes a message format on a Kafka topic used by four consumers. How?

AdvancedScenarioDeployments and releases
Answer

Situation read → Producers and consumers deploy independently; a breaking message change can crash consumers or poison the topic.

What I'd do →

  1. Use a schema registry (Avro or Protobuf) with compatibility mode set to BACKWARD or FULL, so incompatible schemas are rejected at registration.
  2. Make the change additive: new optional fields with defaults. Never rename or change field types in place.
  3. Upgrade consumers first so they can read both old and new formats, then upgrade the producer.
  4. For a true breaking change, publish to a new topic (orders.v2), dual-write for a period, migrate consumers, then retire the old topic.
  5. Monitor consumer lag and dead-letter queues during rollout.

Why → Old messages stay in the topic for the retention period; consumers must handle both formats long after the deploy.

Interview tip → "Consumers first, producer second" is the key ordering.

All Real-World Interview questions Roadmap: Interview readiness

More on Deployments and releases