Relative Content

Tag Archive for apache-kafkaavroconfluent-schema-registry

Scalable AVRO schema for Kafka topic

I have an application in which am using Kafka with schema registry to produce messages.I have a topic called plans , in which there are fields like id,name,type etc.,. Now there are deiffrent fields which are having a value only for certain type of plans. Example am having fields such as ‘time’ ,`duration’ for only one type of plan . And there are different fields which are common for 2 or 3 types of plans . The current AVRO schema is linear , so if i have to add a new type of plan , again i will add 2 or 3 fields which are having a value directly in to schema . This is causing the fields to grow horizontally at consumer end . Is there any way using which i can come up with a scalable AVRO schema which may of some nested type , so that the fields won’t grow horizontally and which is not complex to use at consumer end also .