Bird
Raised Fist0

Which of the following is the correct way to specify a schema in Kafka using Avro?

easy📝 Syntax Q3 of Q15
Kafka - Schema Registry
Which of the following is the correct way to specify a schema in Kafka using Avro?
AUse XML schema files directly in Kafka topics.
BWrite a SQL CREATE TABLE statement.
CDefine a JSON schema and register it in the Schema Registry.
DEmbed schema in Kafka broker configuration files.
Step-by-Step Solution
Solution:
  1. Step 1: Identify Avro schema usage

    Avro schemas are JSON-based and registered in Schema Registry for Kafka.
  2. Step 2: Eliminate incorrect options

    SQL and XML are not used directly for Kafka schema; broker configs don't hold schemas.
  3. Final Answer:

    Define a JSON schema and register it in the Schema Registry. -> Option C
  4. Quick Check:

    Avro schema format = JSON + Schema Registry [OK]
Quick Trick: Avro schemas are JSON registered in Schema Registry [OK]
Common Mistakes:
MISTAKES
  • Confusing SQL or XML with Avro schema format
  • Thinking schemas are stored in broker configs
  • Not using Schema Registry for schema storage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes