Kafka Schema Compatibility Checker

Will the Schema Registry accept this version? Avro's reader and writer resolution, written out from the specification, with the exact path into the schema that the registry's own error message leaves out.

BACKWARD asks whether a consumer on the new schema can read what is already in the topic, so the new schema is the reader. FORWARD asks the opposite. A transitive level checks every registered version rather than only the latest, which is the difference between a safe chain and a safe pair.

Nothing is uploaded: the comparison runs in this tab.

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Checking compatibility in the wrong direction

    BACKWARD means a new schema can read old data, FORWARD means old readers can read new data. Which you need depends on whether producers or consumers upgrade first.

    Instead:Decide the deployment order, then set the compatibility mode to match.

  2. Assuming the default mode is what you want

    Confluent Schema Registry defaults to BACKWARD, which permits deleting a field and blocks adding a required one. That is right for consumer-first upgrades and wrong for producer-first.

    Instead:Set it explicitly per subject.

  3. Testing only the latest version

    BACKWARD checks against the immediately previous schema. BACKWARD_TRANSITIVE checks against all of them, and only the transitive mode protects a consumer reading old data.

    Instead:Use the transitive mode where old data is still readable in the topic.

Reader, writer, and which one your new schema is

The compatibility levels are named for what a consumer can do, not for what a producer did. Reading them the other way inverts every answer, and the two directions are symmetrical enough that a wrong reading looks right about half the time.

BACKWARD makes the new schema the reader

It asks whether a consumer that has been upgraded can still read what is already in the topic. So the new schema is the reader and the registered one is the writer, and the reader's defaults are what fill the fields the old data never had. This is the registry's default when nothing is set on the subject, and it is the right default when consumers are upgraded before producers.

FORWARD is the other way round

A consumer still on the registered schema has to be able to read data written with the new one. The old schema is the reader, so its defaults do the work and the new schema's defaults are irrelevant. This is what you want when producers move first, and it is why adding a field with no default passes FORWARD while failing BACKWARD: the old consumer simply ignores a field it does not know about.

A field with no default is the whole of backward compatibility

A reader substitutes a field's default for data written before the field existed. Without one there is nothing to substitute, so none of the existing data can be read. Nothing else about the change matters, and adding the default is the entire fix. For an optional field the shape is ["null", T] with a default of null, and null has to be the first branch or the default itself is invalid.

{"name": "note",
 "type": ["null", "string"],
 "default": null}
// safe to add. Without the default,
// nothing already in the topic reads

Transitive exists because a chain of safe steps is not safe

A non-transitive level checks the latest registered version only, which is the registry's behaviour rather than a shortcut here. So version 1 can hold a field as an int, version 2 can drop it, and version 3 can bring it back as a string with a default. Each step is backward compatible with the one before it, and version 3 cannot read version 1's data at all. Paste every registered version, oldest first, separated by a line of three dashes, and pick a transitive level to check them all.

The namespace move that passes and still breaks everything

Avro's own compatibility check compares the short name of a type and then the reader's aliases, not the fullname. Moving a record from com.acme.v1 to com.acme.v2 is therefore compatible as far as the registry is concerned. Generated classes move package, the canonical form and the fingerprint both change, and any consumer resolving by fullname stops matching. That is reported here beside a passing verdict rather than folded into either answer.

What this cannot see

Your registry, your subject, and which level is actually set on it. It also does not know your subject naming strategy, so it cannot tell you whether these two schemas are even under the same subject. Check the level with a GET on /config/<subject>, which falls back to the global one when nothing is set. Everything here runs in your browser and no schema is sent anywhere.

More kafka tools

Kafka Confluent Wire Format Decoder The five junk bytes in front of your payload Kafka Key to Partition Mapper Which partition does this key land on? Kafka Topic Name Validator Legal, risky, or 249 characters too long? Kafka Replication Safety Checker How many brokers can you lose Kafka Producer Config Linter Will it start, and will it lose a record? Kafka Message Payload Decoder The first five bytes are usually not data Kafka Connect Source Connector Generator tasks.max is a ceiling, not a count Kafka Connect Sink Connector Generator A dead letter queue with no context headers is a pile of records Kafka Connect SMT Chain Builder The order is the transforms list Kafka MirrorMaker 2 Config Generator It renames every topic by default Kafka Partition Reassignment Generator The throttle is not optional Strimzi Kafka Resource Generator Without the cluster label, nothing happens Kafka mTLS Config Generator The certificate is the identity Kafka Schema Registry Config Generator The compatibility direction is your deployment order Kafka Exactly-Once Config Generator Half of it is worse than none Kafka Broker and KRaft Config Generator The internal topics that break a one-broker cluster Kafka Quota Generator Byte rates are per broker, not per cluster Kafka Streams Config Generator application.id is four things at once Kafka Connect Worker Config Generator Security three times, or the tasks fail Kafka Retention and Unit Converter log.retention.hours does not take milliseconds Kafka Timestamp Converter Two sentinels and two meanings Kafka .properties to YAML Converter Dotted keys stay flat Kafka Streams Internal Topic Predictor Create them before Streams does Kafka ACL Generator The grant you forgot is on another resource type Kafka Topic Config Generator min.insync.replicas is the one that matters Kafka client.properties Generator The file every CLI tool asks for Kafka Producer Config Generator No password field, on purpose Kafka Consumer Config Generator The commit mode decides the semantics Kafka Disk and Retention Calculator retention.bytes is per partition Kafka Partition Count Calculator The number you can never reduce Kafka Cluster Sizing Calculator The traffic no client metric shows Kafka Consumer Lag Catch-Up Calculator Whether it ever clears, not just when Kafka Producer Batching Calculator linger.ms=0 still batches Kafka Segment and Index Sizing Why retention.ms is a lower bound Kafka Rebalance Duration Estimator What a rolling restart really costs Kafka Cost Estimator Your rates, so nothing goes stale Kafka Config Explorer by Version The answer depends on the release Kafka Default Config Reference What moved under a config you never edited Kafka OAuth Bearer Token Decoder Will Kafka accept it, and can it refresh Kafka Record Header Viewer Headers are a list, not a map Kafka Topic Regex Subscription Tester Kafka matches the whole name Kafka ACL Permission Matrix Viewer DENY beats every ALLOW Kafka Connect Config Validator The mistakes that raise no error Kafka Consumer Group Id Validator Which broker coordinates the group Kafka Partition Assignment Visualizer Leadership is the load, not replicas Kafka Consumer Assignment Visualizer The three assignors disagree Kafka ZooKeeper to KRaft Config Converter The authorizer class nobody changes Kafka Config to Strimzi Half of it belongs elsewhere Kafka Docker Compose Generator (KRaft) Reachable from inside and outside Kafka JAAS Config Decoder The line that stops SASL working Kafka CRC32C Calculator Which CRC, over which bytes Kafka Config Upgrade Checker What breaks when you upgrade Kafka Kafka Config Diff Which change actually changed something Kafka Consumer Config Linter Why the group rebalances, and where the records went Kafka Avro Schema Validator The defaults Avro accepts and rejects Kafka Avro Schema Diff Which direction each change breaks Kafka Compression Comparison Measured on your bytes Kafka Delivery Semantics Exactly-once has a consumer half Kafka ksqlDB Query Builder It looks like SQL and the rules are not Kafka Connect SMT Predicate Tester negate reads backwards Kafka Streams Topology Viewer Count the repartitions Kafka Connect Pipeline Visualizer The order things really run in Kafka Protobuf Binary Decoder Works without the .proto Kafka Protobuf JSON Converter Why your JSON does not round-trip Kafka Protobuf to Avro Schema What does not survive the conversion Kafka Avro Binary Decoder Wrong schema, no error Kafka Avro JSON Converter Why the console producer rejects your line Kafka Avro Sample Data Generator Records that actually serialize Kafka JSON to Avro Schema What JSON cannot tell you Kafka JSON Schema to Avro What does not survive the conversion Kafka SASL JAAS Generator One login module, four syntaxes Kafka CLI Command Builder kcat is librdkafka, not Kafka

Elsewhere on the site