Serialization
In the previous chapters, we learned how to scaffold Go microservices, create HTTP API endpoints, and set up service discovery to let our microservices communicate with each other. This knowledge already provides a solid foundation for building microservices; however, we are going to continue our journey with more advanced topics.
In this chapter, we will explore serialization, a process that allows data to be encoded and decoded so that it can be stored or sent between services. To illustrate how to use it, we are going to define data structures that will be transferred between our microservices using the popular and efficient Protocol Buffers format. Then, we are going to show you how to generate code for the newly introduced data structures. Finally, we will demonstrate how fast our Protocol Buffers-based serialization is compared to some other formats, such as XML and JSON. By the end of this chapter, you will know how to leverage the serialization technique...