3 ms·
Haven’t used protobufs for years but as I remember it you can use an old schema to read a newer version object, discarding the new fields. I don’t think that wo
by svachalek 6y ago
Haven’t used protobufs for years but as I remember it you can use an old schema to read a newer version object, discarding the new fields. I don’t think that would be possible without the TLV.
- mumblemumble 6y agoflatbuffers also support this, but use offset tables instead of TLV. It may be that TLV is necessary if you want to do this in a format that is designed for streaming rather than random access.
- cryptonector 6y agoThis is called "extensibility". In ASN.1 people were doing the same thing unofficially in the mid-80s, then explicit support was added in the form of "extensibility markers". There's nothing new in protobufs. EDIT: I should add that the non-TLV encoding rules for ASN.1 all support extensibility. Also, there are good engineering practices and security reasons why one should want explicit documentation of what structures/enums/choices/typeranges are expected to be extensible. Relying on decoders to ignore unexpected bits is not a sound practice.