Clarification on Schema Registry in Kafka

Scenario:

I’m using Kafka service in Aiven. I enabled Schema Registry API and created a schema. Then, I implemented producer and consumer in golang. I followed bellow steps basically.

Producer

  • Producer talks to the Schema Registry and checks whether the relevant schema is available.

  • If the producer can’t find the schema in the schema registry, it registers the new schema and cache it in the schema registry.

  • Then, the producer serializes the data with the schema and sends it to Kafka in binary format prepended with a unique schema ID.

Consumer

  • it will communicate with the schema registry using the schema ID it got from the producer and deserialize it using the same schema.

  • If there is a schema mismatch, the schema registry will throw an error.

I have few questions to clarify:

  • Is what I have done is correct? Is that the proper way using the schema registries?
  • Here, to get the schema from schema registry, I talked to an endpoint https://{prefix}:14276/schemas/ids/{schemaId}. But, there was no clue about this endpoint aiven docs (I think I didn’t miss). So, this questions me whether I have used the schema registries correctly.
  • General question: what is the schema registry used by Aiven?

Hey Sumudu,
Thanks for your question. Your understanding and approach are correct. Aiven implemented its own open-source version of Kafka REST and Schema registry under common project name Karapace. The API resource which you mentioned is documented as part of the repository Quickstart and we are currently working on extending Aiven user documentation. We hope this helps and that you are enjoying your experience with Aiven!

2 Likes

Thanks Julien for the clarification!