Data schema registry
Note
This feature is in the Preview stage.
Schema Registry implements a schema registry, i.e., a centralized repository for managing and validating data schemas. The schema registry ensures safe data schema evolution, resolves data compatibility issues, and enhances system performance by reducing the volume of data transmitted over the network. Moreover, the schema registry will allow you to satisfy data security requirements and promote collaboration across teams. In Schema Registry, you can add schemas in Avro
Namespace
A namespace is a certain number of schemas. Schemas and subjects of different namespaces are completely isolated from one another. It is up to the user to decide how many namespaces to create and what principle to follow for placing schemas in them. You cannot create references between schemas from different namespaces.
Subject
A subject
The particular subject version contains metainformation about the schema and the schema itself. Subject versions are numbered sequentially incrementing by 1. Each subject version is unique and contains only one schema. You can compare schemas in different versions of a subject.
Schema
A _schema_
Schemas are used to check data structure in messages on events, thereby ensuring that producers and consumers send and receive data in the same format. You can define schemas in a schema registry only within a given subject.
You can edit a data schema. To do this, upload an updated schema to a subject. The new schema will appear in the new subject version:
Warning
Changing the schema type may result in incorrect schema compatibility checks in different versions of the subject.
Reference
A reference (schema reference
- Reference name. For Avro, a reference name is a full schema name; for JSON, it is a URL address; and for Protobuf, a name of a Protobuf file with a schema (as stated in the
import
directive). - Subject name used to register the referenced schema.
- Subject version containing the referenced schema.
Example of a Protobuf schema reference
Let's take a look at the msg2.proto
schema in the test-msg2
subject that refers to the msg1.proto
schema in the test-msg1
subject.
msg1.proto
file contents:
message msg1 {
int8 my_field = 1
}
msg2.proto
contents:
import "msg1.proto"
message msg2 {
msg1 my_field = 1
}
To link these schemas, add a reference with the following parameters when loading the msg2.proto
schema into the test-msg2
subject:
msg1.proto
: Reference name.test-msg1
: Subject name used to register the referenced schema,msg1.proto
.1
:test-msg1
subject version containing the referenced schema.