A producer must add a required field, venue, to a message type read by 40 consumers, some of which deploy only weekly. Give the sequence of changes that never breaks a running consumer, and name the property of the serialisation format the sequence depends on.

A producer must add a required field, venue, to a message type read by 40 consumers, some of which deploy only weekly. Give the sequence of changes that never breaks a running consumer, and name the property of the serialisation format the sequence depends on.

Approach: Order the deploys so that no reader ever meets a message it cannot decode, and treat required as a state reached at the end rather than as the change itself.

Add the field as optional with a default value, deploy every consumer to read it, wait until all 40 have deployed and the old builds are retired, then make it required in a second schema change. The sequence depends on the format being both backward and forward compatible for an added optional field: a new consumer reading an old message receives the default, which is backward compatibility, and an old consumer reading a new message skips the unknown field, which is forward compatibility. Avro with a schema registry, protobuf with a reserved field number, and JSON with a reader that ignores unknown keys all provide this. A positional format such as bare CSV does not, because an inserted column shifts every later field and every old reader misreads the message with no error at all. Enforce the rule with a compatibility check in the registry so an incompatible schema cannot be published, and set the mode to FULL rather than BACKWARD when producers and consumers deploy independently. The step that fails in practice is the last one: making the field required while one weekly consumer still runs old code turns a decode error into a stalled partition, so gate that change on an observed count of active consumer versions rather than on a calendar date.

Follow-up: How do you handle the same change when the field cannot be defaulted because its absence is meaningful?

Key concepts: backward compatibility, forward compatibility, default value, schema registry.