liveBook · Manning

Backward compatibility

As explained in Troubleshooting Java, Second Edition

Backward compatibility is the ability of a newer consumer or implementation to process data produced according to an older schema.

Backward compatibility lets a newer consumer or implementation process data produced under an older schema. It matters when services evolve independently and must avoid silently dropped data, default values, or deserialization failures. section 12.2

Investigate compatibility when:

  • A service adds a JSON field while another service still uses the older model. section 12.2
  • A Protobuf enum is renamed or a field is not made optional. section 12.2
  • A Java object is serialized with one version UID but deserialized with a different class. section 12.2
message Order {
  int64 id = 1;
  string customer_id = 2;
  repeated string items = 3;
  optional string notes = 4;
}

Use this Protobuf schema to inspect how fields are numbered, repeated, and marked optional while a message evolves. section 12.2

How Troubleshooting Java, Second Edition covers it

How deep it goes
Explains common mismatch symptoms and schema-evolution concerns, but stops short of a compatibility checklist or implementation procedure.
Examples
Uses added JSON fields, renamed Protobuf enums, optional fields, and Java version-UID mismatches as failure scenarios.
What it assumes
Assumes basic service communication and serialization concepts while defining Protobuf and deserialization terminology.
What you can do after
Diagnose compatibility risks by examining schema changes, ignored fields, default values, and deserialization errors.
How it connects
Connects serialization, versioning, data contracts, JSON, Protobuf, gRPC, and Java deserialization.

Also explained in

Compare how 18 books explain backward compatibility →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Troubleshooting Java, Second Edition. The section links point to the parts of the book it draws on.