January 2020
Intermediate to advanced
640 pages
16h 56m
English
Each field in a protocol buffer message is assigned a unique ID. The most common pattern is to assign IDs in an incremental fashion, starting from 1. When a field is serialized to the wire format, the serializer emits a small header that contains information about the field type, its size (for variable-sized fields), and its ID.
The receiver scans the header and checks whether a field with that ID is present in its local message definition. If so, the field value is unserialized from the stream to the appropriate field. Otherwise, the receiver uses the information in the header to skip over any fields it does not recognize.
This feature is extremely important as it forms the basis for versioning message definitions. ...