There are usually two types of considerations associated with data storage and transmission: I pretty much laid the foundation for why we should be already considering protocol buffer but if that’s not convincing enough, let’s discuss some more to make the usage of it reasonable. You need to define the structure of data once and then a special generated source code is used to read and write the structured data to and from a variety of data streams and languages. They are like XML but more flexible, efficient, automated, smaller, faster and simpler. That’s exactly where protobuf appears in the picture. You need specified protocols to handle huge traffic. This will give you flexibility but not a good idea when you have tremendous amount of data. So what now? Yeah, you can sure go ahead and invent your own serialization technique. Also, encoding and decoding can impose great performance penalty on application. This approach is great for front end since it is human readable but what about backend server to server communication? These formats are space intensive. Serialize the data to XML (Extensible Markup Language) or JSON (JavaScript object notation).Also it’s really hard to extend this format. The code must be compiled with the same memory layout and endianness, etc. But what if I want to retrieve that data over some other memory layout? A straight forward No! That’s not how we play. The raw, in-memory data structures can be sent or saved in binary form.But what should be the format in which data should be serialized? Here are few fixes for this: Which in simple words mean that we need to serialize data if we are to store it or transfer. “Serialization is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer) or transmitted (for example, across a network connection link) and reconstructed later (possibly in a different computer environment)”. To fully get the concept of protobuf, we first need to understand what is serialization and what are the problems we had that needed to be solved. So for this article, we’ll be talking about: Allow me to walk you through it until everything becomes clear. Now if you didn’t get all those heavy terms at first, it’s fine. Protocol buffer is language-agnostic binary data format developed by Google to serialize the structured data between different services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |