Schema entities

Learn about the three types of schema entity types: Schema Group, Schema Metadata, Schema Version.

You can use Schema Registry to work with three types of schema entities. The following image shows the types of Schema entities:


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

Table 1. Schema entity types
Entity Type Description Example
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:

  • 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.

  • 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 Version The 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"}
  ]
}