0Pricing
Apache Kafka & Stream Processing Fundamentals · Lesson

Schema Evolution & Compatibility Modes

Learn how Confluent Schema Registry enforces compatibility as schemas change, and how to choose backward, forward, or full compatibility safely.

Schema Evolution & Compatibility Modes is a free Apache Kafka & Stream Processing Fundamentals lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Apache Kafka & Stream Processing Fundamentals learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why Schemas Evolve

Data contracts change over time — you add fields, deprecate others, rename things. Schema evolution is the discipline of changing schemas without breaking existing producers and consumers.

The Compatibility Problem

Producers and consumers often deploy at different times. A new producer might emit a v2 schema while old consumers still expect v1.

Without rules, that mismatch causes deserialization failures in production.

Backward Compatibility

Backward: new schema can read data written with the old schema.

  • Safe changes: delete a field, add a field with a default.
  • Upgrade consumers first.

Forward Compatibility

Forward: old schema can read data written with the new schema.

  • Safe changes: add a field, delete a field that had a default.
  • Upgrade producers first.

Full Compatibility

Full requires both backward and forward compatibility at once.

  • Only changes safe in both directions are allowed (add/remove fields with defaults).
  • Producers and consumers can be upgraded in any order.

Transitive Variants

Each mode has a transitive version (BACKWARD_TRANSITIVE, etc.).

Non-transitive checks only against the latest schema; transitive checks against all prior versions — stronger guarantees, more constraints.

Setting Compatibility

Compatibility is configured per subject (or globally) via the Schema Registry REST API.

curl -X PUT \
  http://localhost:8081/config/orders-value \
  -H 'Content-Type: application/vnd.schemaregistry.v1+json' \
  -d '{"compatibility": "BACKWARD"}'

A Backward-Safe Avro Change

Adding a field with a default keeps old data readable under BACKWARD mode.

{
  "type": "record",
  "name": "Order",
  "fields": [
    {"name": "id", "type": "string"},
    {"name": "amount", "type": "double"},
    {"name": "currency", "type": "string", "default": "USD"}
  ]
}

Testing Before You Register

The registry can check a candidate schema against the current one before you commit it.

curl -X POST \
  http://localhost:8081/compatibility/subjects/orders-value/versions/latest \
  -H 'Content-Type: application/vnd.schemaregistry.v1+json' \
  -d '{"schema": "...escaped avro..."}'

Breaking Changes

Changes that almost always break compatibility:

  • Renaming a field (treated as delete + add).
  • Changing a field's type incompatibly.
  • Adding a required field with no default.

For these, create a new subject/topic version instead.

Choosing a Mode

Rules of thumb:

  • BACKWARD (default) when you upgrade consumers first.
  • FORWARD when producers lead.
  • FULL for independently deployed teams.
  • Use transitive variants for long-lived, replayable topics.

Quick Check

Test your understanding of compatibility modes.

Recap

You learned schema evolution and compatibility modes.

  • BACKWARD: new reads old, upgrade consumers first.
  • FORWARD: old reads new, upgrade producers first.
  • FULL: both, any order.
  • Transitive variants check all prior versions; renames and required no-default fields break compatibility.

Frequently asked questions

Is the “Schema Evolution & Compatibility Modes” lesson free?

Yes — the full text of “Schema Evolution & Compatibility Modes” is free to read here on the web, and the Apache Kafka & Stream Processing Fundamentals course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Apache Kafka & Stream Processing Fundamentals course, upgrade to CoddyKit PRO.

What will I learn in “Schema Evolution & Compatibility Modes”?

Learn how Confluent Schema Registry enforces compatibility as schemas change, and how to choose backward, forward, or full compatibility safely. You practise Apache Kafka & Stream Processing Fundamentals with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Apache Kafka & Stream Processing Fundamentals?

No prior experience is required. Apache Kafka & Stream Processing Fundamentals on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Schema Evolution & Compatibility Modes” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Apache Kafka & Stream Processing Fundamentals lesson?

Yes. Every Apache Kafka & Stream Processing Fundamentals lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Schema Management?
  2. Avro & Protobuf Schemas
  3. Integrating Schema Registry with Kafka
  4. Schema Evolution & Compatibility Modes
← Back to Apache Kafka & Stream Processing Fundamentals