Protobuf Primer
As we now understand the basic networking concepts behind gRPC, we can touch upon another pillar in the construction of your gRPC APIs. This pillar is Protocol Buffers, more commonly known as Protobuf. It is an important part of the communication process because, as we saw in the previous chapter, every message is encoded into binary, and this is exactly what Protobuf is doing for us in gRPC. In this chapter, the goal is to understand what Protobuf is and why it is needed for high-efficiency communication. Finally, we are going to look at some details concerning the serialization and deserialization of messages.
In this chapter, we’re going to cover the following main topics:
- Protobuf is an Interface Description Language (IDL)
- Serialization/deserialization
- Protobuf versus JSON
- Encoding details
- Common types
- Services