appendix A Schema compatibility workshop
In this appendix, you’ll take a guided walkthrough of updating schemas in different compatibility modes. You’ll change the schemas compatibility mode, make changes, test those changes, and finally run updated producers and consumers to see the different compatibility modes in action. I’ve already made all the changes. You only need to read along and run the provided commands. There are three subprojects: sr-backward
, sr-forward
, and sr-full
. Each subproject contains producers, consumers, and schemas updated and configured for the representative compatibility mode.
Note There is a lot of overlap between the code and the build.gradle files between the subprojects. This overlap is intentional, as I wanted each module isolated. The focus of using these modules is learning about evolving schemas in Schema Registry and the related changes you need to make to Kafka producers and consumers, not how to set up the ideal Gradle project!
In this section, I’ll discuss how Schema Registry ensures client compatibility. For schema compatibility rules of the serialization frameworks, you’ll want to look at each one specifically. Avro schema resolution rules are available at http://mng.bz/ngE2. Protobuf provides backward compatibility rules in the language specification found at http://mng.bz/v8r4.