We would like to serialize structured data to transmit information over networks to avoid intensive cpu executions and related risks. So, we use a serialization mechanism to enable faster* data transfer of platform independence, data interexchange over heterogeneous distributed systems, and more
syntax = "proto2";
package tutorial;
message Person {
required string name = 1;
required int32 id = 2; optional string email = 3;
enum PhoneType { MOBILE = 0;
HOME = 1; WORK = 2; }
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}repeated PhoneNumber phones = 4;}
Created by Google, Protocol Buffers are a binary encoding format of data into efficient and extensible format.
Facts
{"firstName": "John",
"lastName": "Smith", "isAlive": true,
"age": 27,
"address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100"
},
"phoneNumbers": [ {
"type": "home", "number": "212 555-1234" }, {
"type": "office", "number": "646 555-4567" }, {
"type": "mobile", "number": "123 456-7890" }
}
eXtensible Markup Language (XML) Tags and Attributes