2. Data Serialization
Data serialization is the process of converting structured data to a format that allows
sharing or storing of data in a from that allow recovery of its original structure. De-
serialization is the exact opposite.
Serialization formats
• XML
• JSON
• CSV
• YML
• Protobuf etc.
3. Protocol buffers
• Protocol buffers are a flexible, efficient, automated mechanism for serializing structured
data and its
• Language-neutral
• Platform-neutral
• Extensible
4. JSON
• Advantages
• Data can take any forms (arrays, nested elements)
• Is a widely accepted format in web
• Can ne read by pretty much any language
• Can be easily shared over a network
• Disadvantages
• Data has no schema enforcing
• Json Objects can be quite big in size because of repeated keys
• No comments, metadata
5. protobuff
• Advantages
• Data is fully typed
• Data is compressed automatically (less CPU usage)
• Schema is needed to generate code and read the data
• Documentation can be embedded in the schema
• Data can be read across any language(Java, C#, Go, Python, JS etc..)
• Schema can be evolved over the time, in a safe manner
• 3-10x smaller, 20-100x faster then XML
• Code is generated for you automatically
• Disadvantages:
• Support for some language might be lacking
• Can’t open the serialized data with the text editor
8. gRPC
• Developed by Google, under the name Stubby.
• In 2015 Google liberalized it as open source and named it gRPC.
• Adopted by large companies in the very first year like Netflix, Cisco, Docker etc.
• Became part of Cloud Native Computing Foundation in 2017.
9. Core features that make it awesome
• Idiomatic client libraries in 11 languages
• Highly efficient on wire and with a simple service definition framework
• Bi-directional streaming with http/2 based transport
• Pluggable auth, tracing, load balancing and health checking
10.
11. gRPC Interaction
• Unary: when the client sends a single request and receives a single response.
• Server-streaming: when the server responds with a stream of messages to a client's request.
Once all the data is sent, the server additionally delivers a status message to complete the
• Client-streaming: when the client sends a stream of messages and in turn receives a single
response message from the server.
• Bidirectional-streaming: the two streams (client and server) are independent, meaning that they
both can transmit messages in any order. The client is the one who initiates and ends the