3 ms·
Resistance to version changes in protocol buffers comes from practice and doctrine that is widespread in the user community, not entirely from the format itself
by jeffbee 3y ago
Resistance to version changes in protocol buffers comes from practice and doctrine that is widespread in the user community, not entirely from the format itself. There is really only 1 point to keep in mind.
1) Never change the type or semantic meaning of a field.
It's really that simple.
- malkia 3y agoPretty much, but a bit more here - https://protobuf.dev/programming-guides/dos-donts/ https://protobuf.dev/programming-guides/dos-donts/
- secondcoming 3y ago2) make all fields optional
- ShadowBanThis01 3y agoI was referring to this oft-cited feature: "Reason #2: Backward Compatibility For Free Numbered fields in proto definitions obviate the need for version checks which is one of the explicitly stated motivations for the design and implementation of Protocol Buffers... With numbered fields, you never have to change the behavior of code going forward to maintain backward compatibility with older versions."