Hacker News new | past | comments | ask | show | jobs | submit login

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.




I 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."


Pretty much, but a bit more here - https://protobuf.dev/programming-guides/dos-donts/


2) make all fields optional




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: