[Yandex Cloud documentation](../../index.md) > [Yandex MetaData Hub](../index.md) > Schema Registry > Getting started

# Getting started with Schema Registry

Manage schema versions with Schema Registry.



{% note info %}

This feature is at the [Preview](../../overview/concepts/launch-stages.md) stage.

{% endnote %}




## Create a namespace {#create-namespace}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) you want to create a connection in.
  1. [Navigate](../../console/operations/select-service.md#select-service) to **Yandex MetaData Hub**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/layout-cells.svg) **Schema Registry**.
  1. Click **Create a namespace**.
  1. In the **Name** field, set a unique name for the namespace.
  1. Optionally, add a namespace description.
  1. Under **Compatibility parameters**:
      1. 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 [this Confluent guide](https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types).
      1. Select a [compatibility policy](../concepts/compatibility-check-policy.md) for JSON schemas:
          * `optional-friendly`: Based on a [solution](#optional-parameters-compatibility-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](https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types) standards and ensures no full compatibility when adding and removing optional parameters.
      1. Select a compatibility policy for Protobuf schemas:
          * `Confluent`: Based on the [Confluent Schema Registry](https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types) standards.
          * `buf`: Based on the Buf v1 standards.
  1. Click **Create**.


{% endlist %}

## Upload a schema to a subject {#add-schema}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the left-hand panel, select ![image](../../_assets/console-icons/branches-down.svg) **Schemas**.
  1. Click **Load a schema**.
  1. 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 [this Confluent guide](https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types).
  1. Set the data format to [Protobuf](https://protobuf.dev/), [Avro](https://avro.apache.org/), or [JSON Schema](https://json-schema.org/) and attach the file.
  1. If a schema references another schema, in the **References** section, click ![add](../../_assets/console-icons/plus.svg) and enter the [reference](../concepts/schema-registry.md#reference) name, the subject name the schema for is registered under for linking, and the registered subject's schema version.
  1. To apply [data schema normalization](https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/index.html#schema-normalization), enable the **Normalization** setting.
  1. If you want to skip the schema compatibility check, enable the relevant option.
  1. Click **Load a schema**.

- API {#api}

  
  1. Install [cURL](https://curl.haxx.se).
  1. [Log in](../api-ref/authentication.md) to perform operations in the API.
  1. [In the new namespace settings](../operations/update-name-space.md), copy its ID.
  1. Use the POST API method to upload and register the schema for a subject. Provide the following in the request: 
     
      * `schemaType`: Data format: [PROTOBUF](https://protobuf.dev/), [AVRO](https://avro.apache.org/), or [JSON](https://json-schema.org/). If `schemaType` is not specified, it defaults to `AVRO`.
      * `schema.type`: Data type, e.g., `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:

            
      ```bash
      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](https://docs.confluent.io/platform/current/schema-registry/develop/api.html#post--subjects-(string-%20subject)-versions).

{% endlist %}

## What's next {what-is-next}

After you create a namespace and register a schema:
1. [Connect to the namespace](../operations/connect-to-namespace.md).
1. [Add schemas to the subject](../operations/add-schema.md).
1. [Compare schema versions](../operations/compare-schemas.md).