ScenarioProduction Scenarios
How do you handle schema evolution when you have 50 consumers reading a Kafka topic?
Reference answer
Using Schema Registry with Avro: 1) Set compatibility=BACKWARD: new schema can read old data (consumers update first, then producers). Or FORWARD: old schema can read new data (producers update first). 2) BACKWARD evolution rules: add optional fields with defaults, never remove or rename required fields. 3) Coordinate deployments: roll consumers first with schema-backward-compatible changes, then roll producer. 4) Test with consumer-compatibility check before publishing new schema: confluent-schema-registry SDK. 5) For breaking changes: create a new topic with a versioned suffix (orders-v2) and migrate consumers gradually. 6) Maintain a schema changelog.
Expected key concepts: BACKWARD, FORWARD, Schema Registry, add optional fields, remove, rename, roll consumers first, breaking changes, versioned topic, migration, compatibility check