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 →
- Use a schema registry (Avro or Protobuf) with compatibility mode set to
BACKWARDorFULL, so incompatible schemas are rejected at registration. - Make the change additive: new optional fields with defaults. Never rename or change field types in place.
- Upgrade consumers first so they can read both old and new formats, then upgrade the producer.
- For a true breaking change, publish to a new topic (
orders.v2), dual-write for a period, migrate consumers, then retire the old topic. - 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.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerA release passed every test in staging but broke in production. How do you investigate?IntermediateHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateHow would you set up a canary release, and what decides whether it gets promoted?Intermediate