<a id="cloud-sr-config"></a>

# Quick Start for Schema Management on Confluent Cloud

Confluent Cloud Schema Registry is a fully managed service for storing and validating schemas
used by Apache Kafka® producers and consumers. You can use Confluent Cloud Schema Registry to manage
schemas in Confluent Cloud.

You enable a single Schema Registry per Confluent Cloud
[environment](../security/access-control/hierarchy/cloud-environments.md#cloud-environments). You access Schema Registry over port 443.

You can create and edit schemas in a schema editor and associate them with
Apache Kafka® topics.



This quick start introduces Schema Registry rather than covering all its capabilities. For
a complete guide, see [Manage Schemas in Confluent Cloud](../sr/schemas-manage.md#sr-prv).

#### IMPORTANT
- Your VPC must be able to communicate with the Confluent Cloud Schema Registry public internet endpoint. For more information, see [Use Confluent Cloud Schema Registry to Connect to a Public Endpoint in a Private Networking Environment](../sr/fundamentals/schema-registry-vpc.md#sr-ccloud-vpc).
- This quick start assumes that you have completed [Quick Start for Confluent Cloud](index.md#cloud-quickstart),
  including installing and using the
  [Confluent CLI](https://docs.confluent.io/confluent-cli/current/install.html).
- This quick start requires that you use both the
  [Confluent Cloud Console](../topics/overview.md#cloud-topics-manage) and the
  [Confluent CLI](https://docs.confluent.io/confluent-cli/current/command-reference/overview.html).

## Sign in to the Cloud Console

Sign in to Confluent Cloud at [https://confluent.cloud](https://confluent.cloud).

<a id="cloud-sr-enable-zones"></a>

## Add a cloud environment

1. Select **Environments** in the navigation menu, choose
   **Add cloud environment**, provide an environment name in the dialog, and
   click **Create**.
2. Choose a [Stream Governance package](../stream-governance/packages.md#stream-gov-packages) to enable
   Schema Registry, Stream Catalog, and Stream Lineage, either upgrade to Advanced
   or accept the Essentials package:
   - Upgrade to Stream Governance Advanced starting at $1/hour
   - Now, continue with Stream Governance Essentials for free

   ![Screenshot of choosing a Stream Governance package](images/dg-packages-choose.png)

   When you add a new environment, Confluent Cloud offers Stream Governance package options.
   Stream Governance Essentials and Advanced packages are available in all
   [Confluent Cloud regions](regions.md#providers-regions).
   - **Essentials**:
     Starting at $0 cost per hour, provides the fundamentals for getting
     started, including Schema Registry with 100 free schemas,
     [stream catalog](../stream-governance/stream-catalog.md#cloud-stream-catalog) with auto-technical metadata
     ingestion, tags metadata, UI, [REST API](../stream-governance/stream-catalog-rest-apis.md#stream-catalog-rest-apis),
     and most features in [stream lineage](../stream-governance/stream-lineage.md#cloud-stream-lineage).
     Pricing is $0.002 per schema per hour on Essentials after the first 100
     free schemas.
   - **Advanced**:
     Starting at $1 per hour, provides features for production workloads,
     including Schema Registry with 20,000 included schemas and a 99.99% uptime
     service-level agreement (SLA),
     [stream catalog](../stream-governance/stream-catalog.md#cloud-stream-catalog) with everything in Essentials
     plus [business metadata](../stream-governance/stream-catalog.md#data-discovery-business-metadata) and
     [GraphQL API](../stream-governance/graphql.md#catalog-graphql),
     and [stream lineage](../stream-governance/stream-lineage.md#cloud-stream-lineage) with everything in
     Essentials plus [point in time lineage](../stream-governance/stream-lineage.md#stream-lineage-point-in-time)
     and [searchable lineage graph](../stream-governance/stream-lineage.md#stream-graph-search).
     The Advanced package also includes support for
     [schema rules](../sr/fundamentals/data-contracts.md#sr-data-contracts).

   #### NOTE
   Only single-zone Dedicated Kafka clusters are available in Jio Cloud regions. Stream Governance
   packages purchased in Jio Cloud regions support a maximum SLA of 99.95%. For more
   information, see [Jio Cloud region availability](regions.md#jio-regions).
3. Create a cluster.
   ![Screenshot of creating a cluster as part of Stream Governance package enablement](images/_get-started/cluster-type-selection.png)

   The Schema Registry cluster is automatically assigned to the same region as this first
   Kafka cluster deployed in an environment.
   This Schema Registry region does not change. It persists regardless of clusters created
   or deleted in other regions.
   The Schema Registry region determines where Schema Registry and Stream Catalog services run and
   where Confluent Cloud stores the corresponding metadata.

<a id="ccloud-sr-manage-api-keys-per-env"></a>

## Create an API key for Confluent Cloud Schema Registry

To use Confluent Cloud Schema Registry for managing Kafka clusters, you need an API key specific to
Schema Registry.

#### NOTE
- The API key for Confluent Cloud Schema Registry is distinct from the API key you created for
  Kafka clusters in the same environment, per the [Quick Start for Confluent Cloud](index.md#cloud-quickstart).
- Confluent Cloud provides one Schema Registry per environment, and each environment can
  contain multiple Kafka clusters. You need an API key/secret pair for each
  Kafka cluster and another for the Schema Registry cluster.

#### IMPORTANT
For application credentials, choose **Service account** when prompted.
Removing a user account also deletes any API keys associated with it,
which can cause an outage for any application still using the key. To
learn more, see [Best Practices for Using API Keys on Confluent Cloud](../security/authenticate/workload-identities/service-accounts/api-keys/best-practices-api-keys.md#api-keys-best-practices).

1. In the environment for which you want to set up Schema Registry, select **API Keys** in
   the navigation menu.
2. Click either **Create key** (if this is your first key in the environment) or
   **Add key**
3. Choose either **My account** (to associate the key with a
   [user account](../security/authenticate/user-identities/user-accounts/overview.md#user-account-types)) or **Service account** (to
   associate the key with a [service account](../security/authenticate/workload-identities/service-accounts/overview.md#service-accounts-overview)),
   then follow the prompts. Service accounts use access control lists (ACLs) for
   finer-grained control.

   Your new Schema Registry key is shown on the Schema Registry API access key list.
   ![Screenshot of Schema Registry in Confluent Cloud listing newly created key](images/_get-started/sr-api-keys-list.png)

### Schema Registry API keys for multi-tenant clusters

Confluent Cloud provides one logical Schema Registry per environment. In multi-tenant
deployments, one physical Schema Registry per cloud and geographic region hosts
many logical schema registries. In these cases, the registries for
different Kafka clusters in different environments have the same URL as the
Confluent Cloud Schema Registry. Confluent Cloud uses API keys that are resource scoped for Schema Registry
clusters to store schemas and route requests to the appropriate logical
clusters.

## Create a topic in Confluent Cloud

Create a new topic to test Schema Registry, even if you already have topics on this
cluster from the prerequisite [Quick Start for Confluent Cloud](index.md#cloud-quickstart).

1. Select the environment.
2. Select the cluster.
3. Click **Topics** in the navigation menu, then click **Create topic**.
   ![Screenshot of new topic dialog in Confluent Cloud](images/_get-started/sr-create-employees-topic.png)

   Name the new topic `employees`, and click **Create with defaults** to add
   it.

<a id="ccloud-sr-create-schema-cli"></a>

## Create a schema

You can create schemas for topics in the following ways:

- From the [Cloud Console](../sr/schemas-manage.md#cloud-schema-create).
- From the Confluent CLI.
- Through the
  [Schema Registry API](/platform/current/schema-registry/develop/api.html), using the
  [POST /subjects/(string: subject)/versions](https://docs.confluent.io/platform/current/schema-registry/develop/api.html#post--subjects-(string-%20subject)-versions)
  endpoint.
- Through the
  [Schema Registry Maven Plugin](/platform/current/schema-registry/develop/maven-plugin.html),
  using the
  [schema-registry:register](https://docs.confluent.io/platform/current/schema-registry/develop/maven-plugin.html#schema-registry-register)
  goal.

This section shows you how to create a schema from the Confluent CLI. This
gives you a complete view of cloud tools and how the Cloud Console
and Confluent CLI interact with the same entities, such as environments,
clusters, topics, and schemas.

If you need more help with the basic Confluent CLI commands, type
`confluent --help`, `confluent schema-registry --help` to drill down, or see
[Quick Start for Confluent Cloud](index.md#cloud-quickstart) and the
[Confluent CLI command reference](https://docs.confluent.io/confluent-cli/current/command-reference/index.html).

1. Sign in to the Confluent CLI.
   ```bash
   confluent login
   ```

   Follow the prompts to enter your credentials (email and password).

   After you log in, Confluent Cloud shows your current organization.
2. Select the environment where you created the `employees` topic. This
   environment might already be selected upon sign-in.

   To verify this, use `confluent environment list` to get the environment
   IDs, followed by `confluent environment use <id>` to select the
   environment you want, if not already the current environment.

   For example:
   ```bash
   confluent environment list
   ```

   Your output should resemble:
   ```none
     Current |     ID     |        Name
   ----------+------------+---------------------
     *       | env-250o2r | default
             | env-abc123 | ccloud-demo
             | env-xyz123 | data-lineage-demo
             | env-def12g | my-new-environment
   ```

   To use “ccloud-demo”:
   ```bash
   confluent environment use env-abc123
   ```
3. Create a file containing the following JSON and name it `employees.json`.
   ```json
   {
      "type" : "record",
      "namespace" : "Example",
      "name" : "Employee",
      "fields" : [
         { "name" : "Name" , "type" : "string" },
         { "name" : "Age" , "type" : "int" }
      ]
   }
   ```
4. Create a schema that uses `employees.json`.
   ```bash
   confluent schema-registry schema create --subject employees-value --schema employees.json --type avro
   ```

   Your output should resemble:
   ```none
   Successfully registered schema with ID: 100001
   ```

## View the topic and associated schema

Return to the Cloud Console to view the new schema for the
`employees` topic.

1. Navigate to the topics list for your cluster.
   ![Screenshot of topics in a cluster](images/_get-started/sr-topics-list-employees.png)
2. Click the **employees** topic you created earlier in this quick start.
3. Click the **Schema** tab.
   - The schema is shown in raw or code view:

   ![Screenshot of schema for employees topic in raw or code view.](images/_get-started/sr-schema-code-view-employees.png)
   - Click the tree view icon above the schema to switch to the
     [tree view](../sr/schemas-manage.md#cloud-schemas-tree-and-code-view).
     Click the arrows next to **fields** to expand the elements in the tree
     view.

   ![Screenshot of schema for employees topic in tree view.](images/_get-started/sr-schema-tree-view-employees.png)

You now have a new schema (`employees-value`) for the `employees` topic in
Confluent Cloud Schema Registry.

<a id="ccloud-sr-manage-schemas-env"></a>

## Configure and manage schemas for an environment

Several tasks related to schemas on Confluent Cloud are managed at the environment
level. This includes
[creating and managing Schema Registry API keys](#ccloud-sr-manage-api-keys-per-env)
along with options to view and search schemas, monitor usage, and set a
compatibility mode for schemas. For more information, see
[View and search all schemas in an environment](#ccloud-schemas-search) and [View and edit global compatibility settings on schemas](#ccloud-sr-compatibility-settings-env).

<a id="ccloud-schemas-search"></a>

### View and search all schemas in an environment

To view a searchable list of all schemas available in a Confluent Cloud environment:

1. Select an environment.
2. Select **Schema Registry** in the navigation menu.

   The schemas list is shown.
   - You can use search to find schemas in longer lists.
   - Click a schema to drill down for more options:
     - View, download, duplicate, or delete the schema
     - Navigate to compatibility settings
     - Traverse the schema version history to view and compare versions

<a id="ccloud-sr-compatibility-settings-env"></a>

### View and edit global compatibility settings on schemas

The default compatibility mode is **Backward**. From the environment-level Schema Registry
settings, you can change the mode, which applies globally to all schemas in an
environment. You can also
[change compatibility settings at the subject level](../sr/schemas-manage.md#cloud-schema-compat-mode).
Subject-level compatibility settings override the global settings.

1. Select an environment.
2. Select **Schema Registry** in the navigation menu.
3. Click **Edit** next to **Compatibility mode**.

   The **Compatibility settings** are shown.
   ![Screenshot of schema compatibility settings on Confluent Cloud](images/_get-started/sr-compatibility-settings.png)
4. Select a mode option:
   - [Backward](/cloud/current/sr/fundamentals/schema-evolution.html#backward-compatibility) (Confluent Schema Registry default)
   - [Transitive backward](/cloud/current/sr/fundamentals/schema-evolution.html#backward-compatibility)
   - [Forward and Transitive forward](/cloud/current/sr/fundamentals/schema-evolution.html#forward-compatibility)
   - [Full and Transitive full](/cloud/current/sr/fundamentals/schema-evolution.html#forward-compatibility)
   - [None](/cloud/current/sr/fundamentals/schema-evolution.html#no-compatibility-checking) (not recommended)

   Descriptions indicate the compatibility behavior for each option. For more information, including the changes allowed for each option, see [Schema Evolution and Compatibility](/cloud/current/sr/fundamentals/schema-evolution.html).
5. Click **Save**.

## Use curl to view and manage schemas



You can also use [curl](https://curl.haxx.se/) commands to view and manage
schemas on Confluent Cloud.

Schema Registry on Confluent Cloud requires that you pass the API key and secret with the
`--user` (or `-u`) flag. For example, to view all
[subjects](/platform/current/schema-registry/index.html#sr-subjects-topics-primer) in the
registry:

```bash
curl --user <schema-registry-api-key>:<schema-registry-api-secret> \
<schema-registry-endpoint>/subjects
```

For more information about using curl commands with Schema Registry, see
[Schema Registry API Usage Examples](/platform/current/schema-registry/develop/using.html).
Except for
[this one example](/platform/current/schema-registry/develop/using.html#use-curl-to-access-sr-in-ccloud),
the examples are for on-premises Schema Registry but many of the commands are relevant to
Confluent Cloud, after you know how to pass your API key and secret as shown here.

## Related content

### Schemas product documentation

- [Work with schemas](../sr/schemas-manage.md#cloud-schemas-manage)
- [Stream Governance on Confluent Cloud](../stream-governance/index.md#cloud-dg)
- [Confluent Cloud Schema Registry Tutorial](/platform/current/schema-registry/schema_registry_ccloud_tutorial.html)
- [Quick Start for Confluent Cloud](index.md#cloud-quickstart)
- [Confluent Cloud Console](../topics/overview.md#create-topics-cloud)
- [Confluent Cloud CLI Schema Registry commands](https://docs.confluent.io/confluent-cli/current/command-reference/schema-registry/index.html)
- [Schema Management](/platform/current/schema-registry/index.html)
- [Migrate Schemas](/platform/current/schema-registry/installation/migrate.html)
- [Confluent Cloud schemas limits and how to free up space](/platform/current/schema-registry/develop/api.html#sr-in-cloud-manage-space)
- [Schema Formats, Serializers, and Deserializers](/platform/current/schema-registry/serdes-develop/index.html)
  (Confluent Platform tools that support application development for Confluent Cloud and
  self-managed systems)
- [Run an automated Confluent Cloud quickstart with Avro, Protobuf, and JSON formats](https://github.com/confluentinc/examples/tree/latest/cp-quickstart/README.md)

### Blog posts and podcasts

- Blog post: [Getting Started with Protobuf in Confluent Cloud](https://www.confluent.io/blog/using-protobuf-in-confluent-cloud/)
- Blog post: [Confluent Platform Now Supports Protobuf, JSON Schema, and Custom Formats](https://www.confluent.io/blog/confluent-platform-now-supports-protobuf-json-schema-custom-formats)
- Blog post: [Confluent Cloud Schema Registry is Now Generally Available](https://www.confluent.io/blog/confluent-cloud-schema-registry-generally-available)
- Podcast: [Schema Registry Made Simple](https://confluent.buzzsprout.com/186154/1220195-schema-registry-made-simple-by-confluent-cloud-ft-magesh-nandakumar)
