QuickDevGuide

Home › Apache Kafka

Serialization & Schema Registry — Apache Kafka

Kafka stores bytes; producers and consumers must agree on a format. A Schema Registry (Confluent, Apicurio, Karapace) stores versioned schemas and enforces compatibility, so a producer can't break consumers. Format Pros Cons JSON human-readable, easy no enforced schema, verbose Avro compact, rich evolution rules, common in Kafka needs registry + codegen Protobuf compact, great tooling, gRPC alignment needs registry for Kafka JSON Schema validated JSON larger messages Compatibility modes Mode Allowed change BACKWARD (default) new consumers can read old data — add optional fields, remove fields FORWARD old consumers can read new data FULL both directions Rule of thumb: add fields with defaults, never rename or change types in place.

Key Takeaways