Serialization Internals
Now that we know how to describe data in Protobuf text format and encode it into binary, we have all the tools we need to learn about the serialization internals. These internals are important to learn because there are a lot of trade-offs between the different types and we need to be aware of them to define efficient schemas.
In this chapter, we’re going to cover the following main topics:
- Variable-length integers
- ZigZag encoding
- Fixed-size integers
- How to choose between integer types
- Length-delimited encoding
- Packed versus unpacked repeated fields
- Maps
By the end of this chapter, you will know how Protobuf encodes/decodes data to/from binary and you will understand the output binary by yourself.