Overview
Also available as:
PDF

Schema Entities

You can use Schema Registry to work with three types of schema entities:

Figure 4.2. Schema entities


The following table provides a more detailed description of the schema entities:

Table 4.1. Schema entity types

Entity TypeDescriptionExample
Schema group

A logical grouping of similar schemas. A Schema Group can be based on any criteria you have for managing schemas.

Schema Groups can have multiple Schema Metadata definitions.

  • Group Name – truck-sensors-log

  • Group Name – truck-sensors-kafka

Schema metadata

Metadata associated with a named schema. A metadata definition is applied to all the schema versions that are assigned to it.

Key metadata elements include the following:

  • Schema Name

    A unique name for each schema. Used as a key to look up schemas.

  • Schema Type

    The format of the schema.

    Note: Avro is currently the only supported type.

  • Compatibility Policy

    The compatibility rules that exist when the new schemas are registered. See Compatibility Policies for more information.

  • Serializers/Deserializers

    A set of serializers and deserializers that you can upload to the registry and associate with schema metadata definitions.

  • Schema Name – truck_events_avro:v

  • Schema Type – avro

  • Compatibility Policy – SchemaCompatibility.BACKWARD

Schema versionThe versioned schema associated a schema metadata definition.
{   
  "type" : "record",   
  "namespace" : "hortonworks.hdp.refapp.trucking",   
  "name" : "truckgeoevent",   
  "fields" : [     
    { "name" : "eventTime" , "type" : "string" },     
    { "name" : "eventSource" , "type" : "string" },      
    { "name" : "truckId" , "type" : "int" },      
    { "name" : "driverId" , "type" : "int"},      
    { "name" : "driverName" , "type" : "string"},      
    { "name" : "routeId" , "type" : "int"},      
    { "name" : "route" , "type" : "string"},      
    { "name" : "eventType" , "type" : "string"},      
    { "name" : "longitude" , "type" : "double"},      
    { "name" : "latitude" , "type" : "double"},     
    { "name" : "correlationId" , "type" : "long"}   
  ]
}