A schema registry is a central service for storing and versioning schemas used by Kafka producers and consumers. It checks whether schema changes are compatible and provides schema information to clients. Registries support Avro, JSON, and Protobuf schemas. section 13.1.3 section 13.1.4
With Avro, storing the schema in the registry and putting only its ID in each Kafka message avoids repeating the schema with every payload. This keeps messages smaller while retaining a link to the schema version. Because Kafka handles byte arrays, schema checks happen on the client side, not in Kafka itself. section 13.1.4 section 13.1.3
{
"type": "record",
"name": "Product",
"namespace": "com.example.supermarket",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "price", "type": "float"},
{"name": "stock", "type": "int"},
{"name": "origin", "type": ["null", "string"], "default": null}
]
}
This Product record illustrates the kind of Avro schema a registry can store and version. section 13.1.4
Plan for operational trade-offs:
- A registry adds a component whose unavailability can affect producers and consumers; multi-cluster setups need careful planning. section 13.1.3
- Schema IDs have no semantic meaning, and manually exporting and importing schemas can change IDs, complicating recovery and migration. section 13.1.3


