Getting started with Schema Registry
Written by
Updated at March 28, 2025
Manage schema versions with Schema Registry.
Note
This feature is in the Preview stage.
Create a namespace
Management console
- In the management console
, select the folder you want to create a connection in. - Select Yandex MetaData Hub.
- In the left-hand panel, select
Schema Registry. - Click Create a namespace.
- In the Name field, set a unique name for the namespace.
- Optionally, add a namespace description.
- Under Compatibility parameters:
- Set Compatibility check level:
BACKWARD
: (Default) Consumers using the new schema can read data written by producers using the latest registered schema.BACKWARD_TRANSITIVE
: Consumers using the new schema can read data written by producers using all previously registered schemas.FORWARD
: Consumers using the latest registered schema can read data written by producers using the new schema.FORWARD_TRANSITIVE
: Consumers using all previously registered schemas can read data written by producers using the new schema.FULL
: New schema is forward and backward compatible with the latest registered schema.FULL_TRANSITIVE
: New schema is forward and backward compatible with all previously registered schemas.NONE
: Schema compatibility checks are disabled.
For more information about schema compatibility types, see the Confluent documentation .
- Select a compatibility policy for JSON schemas:
optional-friendly
: Based on a solution using various content models for the producer and the consumer. It supports adding or removing optional parameters while maintaining full transitive compatibility.Confluent
: Follows the Confluent Schema Registry standards and ensures no full compatibility when adding and removing optional parameters.
- Select a compatibility policy for Protobuf schemas:
Confluent
: Based on the Confluent Schema Registry standards.buf
: Based on the Buf v1 standards.
- Set Compatibility check level:
- Click Create.
Upload a schema to a subject
Management console
API
- In the left-hand panel, select
Schemas. - Click Load a schema.
- Select the method for schema uploading into the new subject and specify the following parameters:
- Name: Unique subject name.
- Optionally, specify the Compatibility check level if you need to change the level inherited from the namespace:
BACKWARD
: (Default) Consumers using the new schema can read data written by producers using the latest registered schema.BACKWARD_TRANSITIVE
: Consumers using the new schema can read data written by producers using all previously registered schemas.FORWARD
: Consumers using the latest registered schema can read data written by producers using the new schema.FORWARD_TRANSITIVE
: Consumers using all previously registered schemas can read data written by producers using the new schema.FULL
: New schema is forward and backward compatible with the latest registered schema.FULL_TRANSITIVE
: New schema is forward and backward compatible with all previously registered schemas.NONE
: Schema compatibility checks are disabled.
For more information about schema compatibility types, see the Confluent documentation .
- Set the data format to Protobuf
, Avro , or JSON Schema and attach the file. - If a schema references another schema, in the References section, click
and enter the reference name, the subject name the schema for is registered under for linking, and the registered subject's schema version. - To apply data schema normalization
, enable the Normalization setting. - If you want to skip the schema compatibility check, enable the relevant option.
- Click Load a schema.
-
Install cURL
. -
Log in to perform operations in the API.
-
In the new namespace settings, copy its ID.
-
Use the POST API method to upload and register the schema for a subject. Provide the following in the request:
schemaType
: Data format: PROTOBUF , AVRO , or JSON . IfschemaType
is not specified, it defaults toAVRO
.schema.type
: Data type. For example,record
.schema.name
: Name of the schema to upload to the subject.schema.fields
: Schema fields. Example:[{\"name\": \"age\", \"type\": \"int\"}]
.- Namespace ID.
- Name of the subject to upload your schema to.
Request format:
curl \ --request POST \ --header "accept: application/json" \ --header "Authorization: <token>" \ --header "Content-Type: application/json" \ --data '{ "schemaType": "<data_format>", "schema": '{ \"type\": \"<data_type>\", \"name\": \"<schema_name>\", \"fields\":[schema_fields]} }' \ https://<namespace_ID>.schema-registry.yandexcloud.net/subjects/<subject_name>/versions
A successful request will return a unique schema ID, e.g.,
{"id":1}
.For examples of requests, see this Confluent article
.
What's next
After you create a namespace and register a schema: