Apache Kafka · KFK-06
Schema Registry & contracts
- 5 h
- requires KFK-05
From your world. dbt contracts and conformed dimensions, enforced on the wire
Explain this to a teammate who knows dbt but not Kafka: how a schema registry lets you evolve an event schema without a flag-day deploy. Use the order event as the example.
Rubric — a good answer covers:
- A topic is bytes. The registry makes it a contract. It checks the contract at registration time, not at consume time.
- The Confluent wire format = magic byte + 4-byte schema id + Avro binary. The consumer fetches the writer schema by id.
- BACKWARD = a reader on the new schema reads old data. Add-field-with-default is OK. Add-required-field is not OK. Upgrade consumers first.
- FORWARD is the mirror image. Upgrade producers first. FULL = both.
- The underlying mechanism is Avro schema resolution. Match by name, fill missing reader fields from defaults, skip writer-only fields.
- Analogy to a dbt contract / conformed dimension. Additive-with-default is safe. Dropping or repurposing a field that others depend on is not safe.
- The registry checks shape, not values. Add validation or rules.