Companion extra Chapter 3
The Avro wire format and the schema cache
The serializer writes a magic byte, a four byte schema ID, and the Avro payload. The first record costs a registry call on each side. The second finds both caches warm and reaches the consumer without the registry being asked at all.
What to notice
See what the five bytes in front of every Avro record buy, and why the registry is asked once per schema rather than once per message.
From Chapter 3: Kafka Producers: Writing Messages to Kafka in Kafka: The Definitive Guide.
Open SVG
Space pauses, R restarts, arrows move between animations