Bird
Raised Fist0

You want to add a new optional field to a Kafka topic's schema without disrupting existing consumers. Which schema management strategy should you use?

hard🚀 Application Q8 of Q15
Kafka - Schema Registry
You want to add a new optional field to a Kafka topic's schema without disrupting existing consumers. Which schema management strategy should you use?
ADisable schema validation temporarily during the update
BRemove all old fields and replace with the new schema version
CChange the field types of existing fields to match the new data
DAdd the new field as optional and maintain backward compatibility in the schema
Step-by-Step Solution
Solution:
  1. Step 1: Understand schema evolution

    Adding optional fields allows schema evolution without breaking existing consumers.
  2. Step 2: Maintain backward compatibility

    By keeping old fields and adding optional ones, older consumers can still deserialize messages.
  3. Final Answer:

    Add the new field as optional and maintain backward compatibility in the schema -> Option D
  4. Quick Check:

    Optional fields preserve backward compatibility [OK]
Quick Trick: Add optional fields to keep compatibility [OK]
Common Mistakes:
MISTAKES
  • Removing old fields breaks consumers
  • Changing existing field types causes incompatibility
  • Disabling validation risks data corruption

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes