Schema Registry
A shared, versioned catalog of event shapes that stops producers from publishing data their consumers cannot read.
See it
What it is
A schema registry is a central catalog of the shapes messages are allowed to have. Producers register an Avro, Protocol Buffers, or JSON Schema contract; messages carry a schema identifier; consumers retrieve that version to decode and validate the data. Confluent Schema Registry is the familiar example in Kafka systems.
Reach for one when many independently deployed producers and consumers share events. Compatibility checks can reject a change before it lands, such as adding a required field with no default that older messages cannot supply. The registry also gives teams a discoverable history instead of scattering copied schema files across repositories.
A registry enforces structural compatibility, not meaning. Changing amount from cents to dollars while leaving it an integer can pass every schema check and still corrupt consumers. Document semantics, reserve removed protobuf field numbers, and test real old and new messages. The registry is also runtime infrastructure, so cache schemas in clients and plan for temporary registry outages.
Ask AI for it
Add Confluent Schema Registry to this Kafka event pipeline using Avro. Define the OrderCreated schema, register it under a topic-value subject, set compatibility to BACKWARD, and serialize each produced record with the Confluent wire format and schema ID. Configure consumers to fetch and cache schemas, reject undecodable records to a dead letter topic, and add a CI check that tests every proposed schema against the registry before deployment. Include compatibility tests for adding an optional field with a default and for rejecting a new required field that has no default.