Bird
Raised Fist0

Given the following schemas, which is the most restrictive compatibility rule that will allow the new schema to be registered without error?

medium📝 Predict Output Q13 of Q15
Kafka - Schema Registry
Given the following schemas, which is the most restrictive compatibility rule that will allow the new schema to be registered without error?

Old schema: {"type": "record", "name": "User", "fields": [{"name": "name", "type": "string"}]}
New schema: {"type": "record", "name": "User", "fields": [{"name": "name", "type": "string"}, {"name": "age", "type": ["null", "int"], "default": null}]}
AFULL
BFORWARD
CNONE
DBACKWARD
Step-by-Step Solution
Solution:
  1. Step 1: Analyze schema change

    The new schema adds a field with a default value, which is backward and forward compatible.
  2. Step 2: Determine compatibility rules allowing this

    FULL compatibility requires both backward and forward compatibility, which this change satisfies.
  3. Final Answer:

    FULL -> Option A
  4. Quick Check:

    Adding default field = FULL compatible [OK]
Quick Trick: Adding default fields supports full compatibility [OK]
Common Mistakes:
MISTAKES
  • Thinking adding fields breaks backward compatibility
  • Confusing NONE with allowing all changes
  • Ignoring default values in new fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes