liveBook · Manning

Forward compatibility

As explained in Apache Kafka in Action

Forward compatibility is schema compatibility in which consumers using an older schema can read data written with a newer schema.

Forward compatibility lets consumers using an older schema read data written with a newer schema. It supports updating producers first while consumers catch up later. section 13.1.2

Adding a product field

Adding category to a product schema can remain forward-compatible: older consumers ignore the new field and continue processing records. However, consumers expecting category cannot read older records unless the field is optional or has a default such as null. section 13.1.2

Use forward compatibility when:

  • Producers and consumers are developed by different teams and data remains available only briefly. section 13.1.2
  • Plan for the trade-off: older consumers can read new data, but newer consumers may not read historical data. section 13.1.2
{
  "id": "123",    #1
  "name": "Coffee Pad",     #1
  "price": "10",     #1
  "stock": 1010,     #1
  "origin": null,    #2
  "category": "utils"    #3
}

A product record showing a newly added category field. section 13.1.2

How Apache Kafka in Action covers it

How deep it goes
Defines the compatibility direction, explains field addition, and identifies the historical-data limitation.
Examples
Uses a product schema that adds category, which older consumers ignore while newer consumers may lack historical values.
What it assumes
Assumes familiarity with schemas, producers, consumers, and historical data.
What you can do after
Apply it by adding fields while allowing older consumers to process newer records.
How it connects
Connects schema evolution with backward compatibility, full compatibility, producers, consumers, and historical data.

Also explained in

Compare how 5 books explain forward compatibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.