chapter eleven

11 Schema registry

 

This chapter covers:

  • Developing an ideal Kafka Maturity Model
  • Focusing on the value schemas can provide for your system
  • Using Avro as for data serialization

As we have discovered the various ways that one can use Kafka, it might be an interesting experiment to think through how you view Kafka the more you utilize it.

If you are familiar with Representational State Transfer (REST) which is a software architectural style, you may have heard of the Richardson Maturity Model. This particular model was developed by Leonard Richardson and shows levels of usage of REST that developers might evolve though.

Let’s look at our first level: of course we are programmers, so we are starting with Level 0. * Level 0: Kafka is used as a enterprise service bus (ESB) or publish/subscribe system. Whether we are replacing a different message broker like RabbitMQ or just starting with this pattern, we are using events as a way to provide asynchronous communication between applications. One example to think about is a application in which a user submits a text document to be converted into a pdf. Once a user submits a document, the application stores the document and then sends a message to a Kafka topic. A Kafka consumer then reads these messages to determine which documents need to be converted into a pdf. In this example, the drive might be to offload work to a backend system that a user knows will not be a response right away. Figure 11.1 shows this message bus in action.

11.1  Schema Registry

11.1.1  Installing Schema Registry

11.1.2  Registry Configuration

11.2  Defining a Schema

11.2.1  A New Schema

11.3  Schema Features

11.3.1  REST API

11.3.2  Client library

11.4  Compatibility Rules

11.4.1  Validate Schema Modifications

11.5  Alternative to a Schema Registry

11.5.1  Create new Topics

11.5.2  Confluent Cloud Schema Registry

11.6  Summary