Microservices can either interact with clients or each other. To implement interaction, you have to choose a protocol and a format to send messages from one communication participant to another. There are many formats and RPC frameworks that simplify the interaction process. In this chapter, we'll discover features of the serde crate, which helps you to make structs serializable and deserializable and compatible with different formats, such as JSON, CBOR, MessagePack, and BSON.
The following topics will be covered in this chapter:
- How to serialize and deserialize data
- How to make custom types types serializable
- Which serialization formats to choose and which to avoid