Create and Manage Schemas Using Control Center for Confluent Platform

Schema Registry provides a centralized repository for managing and validating schemas for topic message data, and for serialization and deserialization of the data over the network. Producers and consumers to Kafka topics can use schemas to ensure data consistency and compatibility as schemas evolve. Schema Registry is a key component for data governance, helping to ensure data quality, adherence to standards, visibility into data lineage, audit capabilities, collaboration across teams, efficient application development protocols, and system performance.

You can create and manage schemas using Confluent Control Center. A simple example is provided in the next section. For a complete guide on how to work with schemas in Control Center, see Manage Schemas in Confluent Platform and Control Center. This guide explains how to create, edit, view, and download value and key schemas, along with comprehensive coverage of schema contexts, schema references, best practices, and more.

Create a topic value schema

  1. Select a cluster.

  2. Click Topics on the menu.

  3. Select a topic.

    The topic overview page is displayed.

  4. Click the Schema tab.

    You are prompted to set a message value schema.

  5. Click Set a schema. The Schema editor appears pre-populated with the basic structure of an Avro schema to use as a starting point, if desired.

  6. For this example, take the default schema context. You can accept the default context, create a new context, or select an existing context other than the default. To learn more, see Work with schema contexts.

  7. Select a schema format type:

    • Avro

    • JSON

    • Protobuf

    Choose Avro if you want to try out the code examples provided in the next steps.

    Tip

    To learn more about each of the schema types, see Formats, Serializers, and Deserializers.

  8. Enter the schema in the editor:

    Copy and paste the following example schema.

    {
     "type": "record",
     "namespace": "my.examples",
     "name": "Payment",
     "fields": [
       {
        "name": "id",
        "type": "string"
       },
       {
        "name": "amount",
        "type": "double"
       }
               ]
    }
    
  9. In edit mode, you have options to:

    • Validate the schema for syntax and structure before you create it.

    • Add schema references with a guided wizard.

    • Choose a context for the schema.

  10. Click Create.

    • If the entered schema is valid, the Schema updated message is briefly displayed in the banner area.

    • If the entered schema is not valid, an Input schema is an invalid Avro schema error is displayed in the banner area.

    If applicable, repeat the procedure as appropriate for the topic key schema.