[go: up one dir, main page]

SlideShare a Scribd company logo
Protocol Buffers
Protocol Buffers
Ceyhan Kasap | Software Infrastructure
Data Serialization
● The process of translating an object into a format
that can be stored in a memory buffer, file or
transported on a network.
● End goal : Reconstruction in another computer
environment.
● Reverse process: Deserialization
Binary Serialization
● Many languages provides built in language
support
● Language specific (Interop issues)
● Example : Java - Serializable marker interface
(increases likelihood of bugs and security holes )
● Item 74: Implement Serializable
judiciously
● Item 78: Consider serialization
proxies instead of serialized instances
Binary Serialization
● Advantages
● Memory efficient
● Fast to emit and parse
● Disadvantages
● Not human readable
● Platform dependent
CROSS PLATFORM SOLUTIONS - XML
(Extensible Markup Language)
● Design goals: simplicity, generality, and usability across
the Internet
● Hierarchical structure, validation via schema (DTD, XSD
etc)
● A common standard with great acceptance.
● Criticism for verbosity and complexity (especially when
namespaces are involved)
CROSS PLATFORM SOLUTIONS - JSON
(Javascript object notation)
● Lightweight data- interchange format
● Uses human-readable text to transmit data objects
consisting of attribute–value pairs.
● Remember: xml is markup language and json is
data format
Google Data Encoding Solution
Options
«At Google, our mission is organizing all of the
world's information.
We use literally thousands of different data formats
and most of these formats are structured, not flat»
https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
Google Data Encoding Solution
Options
« Not efficient enough for this scale.
Writing code to work with the DOM tree can
sometimes become unwieldy.»
Option 1 : Use XML
https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
Google Data Encoding Solution
Options
«When we roll out a new version of a server, it
almost always has to start out talking to older
servers.
Also, we use many languages, so we need a portable
solution.»
Option 2 : write the raw bytes of in-memory data
structures to the wire
https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
Google Data Encoding Solution
Options
« there was a format for requests and responses
that used hand marshalling/unmarshalling of
requests and responses, and that supported a
number of versions of the protocol....»
Option 3 : Use hand-coded parsing and serialization
routines for each data structure (used solution
before protocol buffers)
https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
What are protocol buffers?
 A language-neutral, platform-neutral, extensible
way of serializing structured data for use in
communications protocols, data storage, and
more.
 Initially developed at Google to deal with an index
server request/response protocol.
 Designed and used since 2001 in Google.
 Open-sourced since 2008.
How do they work?
 You define your structured data format in a
descriptor file (.proto file)
 You run the protocol buffer compiler for your
application's language on your .proto file to
generate data access classes.
 You can even update your data structure without
breaking deployed programs that are compiled
against the "old" format.
How do they work?
.proto Java
Message Definition
 Messages defined in .proto files
 Syntax:
Message [MessageName] { ... }
 Can be nested
 Will be converted to e.g. a Java class
Message Contents
 Each message may have
 Messages
 Enums:
enum <name> {
valuename = value;
}
 Fields
 Each field is defined as
<rule> <type> <name> = <id> {[<options>]};
 Rules : required, optional, repeated
Generated Code
MESSAGES
• Immutable (Person.java)
BUILDERS
• (Person.Builder.java)
ENUMS & NESTED CLASSES
• Person.PhoneType.MOBILE
• Person. PhoneNumber
PARSING & SERIALIZATION
• writeTo(final OutputStream output)
• parseFrom(byte[] data), parseFrom(java.io.InputStream input)
Backward / Forward Compatibility
 DO NOT change the tag numbers of any existing
fields.
 You can delete optional or repeated fields, but you
must not add or delete any required fields.
Backward / Forward Compatibility
 When adding new field you must use fresh tag
numbers… (i.e. tag numbers that were never used
in this protocol buffer, not even by deleted fields).
 A good practice :
 Make your deleted fields are reserved.
 Protocol buffer compiler complains if reserved
fields are used.
Backward / Forward Compatibility
 Changing a default value is generally OK …
 But remember that default values are never sent
over the wire.
Sender Receiver
Receiver reads value as 20 if not sent by sender
Performance Comparison
http://homepages.lasige.di.fc.ul.pt/~vielmo/notes/2014_02_12_smalltalk_protocol_buffers.pdf
Performance Comparison
http://homepages.lasige.di.fc.ul.pt/~vielmo/notes/2014_02_12_smalltalk_protocol_buffers.pdf
Possible Use Cases For Us?
 Java, C++, C#
 IBM MQ / Solace messages
 DB raw data
 Log messages to disk
 Show as XML / JSON
 exe utility associated with protobuf files
Use Cases at Barclays Investment Bank
http://www.slideshare.net/SergeyPodolsky/google-protocol-buffers-56085699
QUESTIONS?

More Related Content

What's hot

HDFS Selective Wire Encryption
HDFS Selective Wire EncryptionHDFS Selective Wire Encryption
HDFS Selective Wire Encryption
Konstantin V. Shvachko
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache Arrow
DataWorks Summit
 

What's hot (20)

Kafka Retry and DLQ
Kafka Retry and DLQKafka Retry and DLQ
Kafka Retry and DLQ
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
 
Overview of Message Queues
Overview of Message QueuesOverview of Message Queues
Overview of Message Queues
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
Kafka and Avro with Confluent Schema Registry
Kafka and Avro with Confluent Schema RegistryKafka and Avro with Confluent Schema Registry
Kafka and Avro with Confluent Schema Registry
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
 
Envoy and Kafka
Envoy and KafkaEnvoy and Kafka
Envoy and Kafka
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
HDFS Selective Wire Encryption
HDFS Selective Wire EncryptionHDFS Selective Wire Encryption
HDFS Selective Wire Encryption
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
Using LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache ArrowUsing LLVM to accelerate processing of data in Apache Arrow
Using LLVM to accelerate processing of data in Apache Arrow
 
Flink history, roadmap and vision
Flink history, roadmap and visionFlink history, roadmap and vision
Flink history, roadmap and vision
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Strata NY 2018: The deconstructed database
Strata NY 2018: The deconstructed databaseStrata NY 2018: The deconstructed database
Strata NY 2018: The deconstructed database
 
Grafana.pptx
Grafana.pptxGrafana.pptx
Grafana.pptx
 

Similar to Protocol Buffers

Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
guest40fc7cd
 

Similar to Protocol Buffers (20)

Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Lotus Domino 8.5
Lotus Domino 8.5Lotus Domino 8.5
Lotus Domino 8.5
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
Event Processing and Integration with IAS Data Processors
Event Processing and Integration with IAS Data ProcessorsEvent Processing and Integration with IAS Data Processors
Event Processing and Integration with IAS Data Processors
 
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GRGlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 
Why Drupal is Rockstar?
Why Drupal is Rockstar?Why Drupal is Rockstar?
Why Drupal is Rockstar?
 
05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Web Scraping Basics
Web Scraping BasicsWeb Scraping Basics
Web Scraping Basics
 
Productionalizing ML : Real Experience
Productionalizing ML : Real ExperienceProductionalizing ML : Real Experience
Productionalizing ML : Real Experience
 
Developing Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache KafkaDeveloping Realtime Data Pipelines With Apache Kafka
Developing Realtime Data Pipelines With Apache Kafka
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOL
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
 
Unit5
Unit5Unit5
Unit5
 
Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?Big Data Streams Architectures. Why? What? How?
Big Data Streams Architectures. Why? What? How?
 
Java platform
Java platformJava platform
Java platform
 
Object- Relational Persistence in Smalltalk
Object- Relational Persistence in SmalltalkObject- Relational Persistence in Smalltalk
Object- Relational Persistence in Smalltalk
 

More from Software Infrastructure

More from Software Infrastructure (20)

Kotlin
KotlinKotlin
Kotlin
 
NoSql
NoSqlNoSql
NoSql
 
Stream Analytics
Stream AnalyticsStream Analytics
Stream Analytics
 
Quartz Scheduler
Quartz SchedulerQuartz Scheduler
Quartz Scheduler
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Deep Learning
Deep Learning Deep Learning
Deep Learning
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Java9
Java9Java9
Java9
 
Machine learning
Machine learningMachine learning
Machine learning
 
Raspberry PI
Raspberry PIRaspberry PI
Raspberry PI
 
Golang
GolangGolang
Golang
 
Codename one
Codename oneCodename one
Codename one
 
Hazelcast sunum
Hazelcast sunumHazelcast sunum
Hazelcast sunum
 
Microsoft bot framework
Microsoft bot frameworkMicrosoft bot framework
Microsoft bot framework
 
Blockchain use cases
Blockchain use casesBlockchain use cases
Blockchain use cases
 
The Fintechs
The FintechsThe Fintechs
The Fintechs
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
Push Notification
Push NotificationPush Notification
Push Notification
 
.Net Core
.Net Core.Net Core
.Net Core
 
Java Batch
Java BatchJava Batch
Java Batch
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Protocol Buffers

  • 1. Protocol Buffers Protocol Buffers Ceyhan Kasap | Software Infrastructure
  • 2. Data Serialization ● The process of translating an object into a format that can be stored in a memory buffer, file or transported on a network. ● End goal : Reconstruction in another computer environment. ● Reverse process: Deserialization
  • 3. Binary Serialization ● Many languages provides built in language support ● Language specific (Interop issues) ● Example : Java - Serializable marker interface (increases likelihood of bugs and security holes ) ● Item 74: Implement Serializable judiciously ● Item 78: Consider serialization proxies instead of serialized instances
  • 4. Binary Serialization ● Advantages ● Memory efficient ● Fast to emit and parse ● Disadvantages ● Not human readable ● Platform dependent
  • 5. CROSS PLATFORM SOLUTIONS - XML (Extensible Markup Language) ● Design goals: simplicity, generality, and usability across the Internet ● Hierarchical structure, validation via schema (DTD, XSD etc) ● A common standard with great acceptance. ● Criticism for verbosity and complexity (especially when namespaces are involved)
  • 6. CROSS PLATFORM SOLUTIONS - JSON (Javascript object notation) ● Lightweight data- interchange format ● Uses human-readable text to transmit data objects consisting of attribute–value pairs. ● Remember: xml is markup language and json is data format
  • 7. Google Data Encoding Solution Options «At Google, our mission is organizing all of the world's information. We use literally thousands of different data formats and most of these formats are structured, not flat» https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  • 8. Google Data Encoding Solution Options « Not efficient enough for this scale. Writing code to work with the DOM tree can sometimes become unwieldy.» Option 1 : Use XML https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  • 9. Google Data Encoding Solution Options «When we roll out a new version of a server, it almost always has to start out talking to older servers. Also, we use many languages, so we need a portable solution.» Option 2 : write the raw bytes of in-memory data structures to the wire https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  • 10. Google Data Encoding Solution Options « there was a format for requests and responses that used hand marshalling/unmarshalling of requests and responses, and that supported a number of versions of the protocol....» Option 3 : Use hand-coded parsing and serialization routines for each data structure (used solution before protocol buffers) https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  • 11. What are protocol buffers?  A language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more.  Initially developed at Google to deal with an index server request/response protocol.  Designed and used since 2001 in Google.  Open-sourced since 2008.
  • 12. How do they work?  You define your structured data format in a descriptor file (.proto file)  You run the protocol buffer compiler for your application's language on your .proto file to generate data access classes.  You can even update your data structure without breaking deployed programs that are compiled against the "old" format.
  • 13. How do they work? .proto Java
  • 14. Message Definition  Messages defined in .proto files  Syntax: Message [MessageName] { ... }  Can be nested  Will be converted to e.g. a Java class
  • 15. Message Contents  Each message may have  Messages  Enums: enum <name> { valuename = value; }  Fields  Each field is defined as <rule> <type> <name> = <id> {[<options>]};  Rules : required, optional, repeated
  • 16. Generated Code MESSAGES • Immutable (Person.java) BUILDERS • (Person.Builder.java) ENUMS & NESTED CLASSES • Person.PhoneType.MOBILE • Person. PhoneNumber PARSING & SERIALIZATION • writeTo(final OutputStream output) • parseFrom(byte[] data), parseFrom(java.io.InputStream input)
  • 17. Backward / Forward Compatibility  DO NOT change the tag numbers of any existing fields.  You can delete optional or repeated fields, but you must not add or delete any required fields.
  • 18. Backward / Forward Compatibility  When adding new field you must use fresh tag numbers… (i.e. tag numbers that were never used in this protocol buffer, not even by deleted fields).  A good practice :  Make your deleted fields are reserved.  Protocol buffer compiler complains if reserved fields are used.
  • 19. Backward / Forward Compatibility  Changing a default value is generally OK …  But remember that default values are never sent over the wire. Sender Receiver Receiver reads value as 20 if not sent by sender
  • 22. Possible Use Cases For Us?  Java, C++, C#  IBM MQ / Solace messages  DB raw data  Log messages to disk  Show as XML / JSON  exe utility associated with protobuf files Use Cases at Barclays Investment Bank http://www.slideshare.net/SergeyPodolsky/google-protocol-buffers-56085699

Editor's Notes

  1. binary not human readable but: platform dependend (Little Endian vs. Big Endian?) + memory efficient fast to parse
  2. binary not human readable but: platform dependend (Little Endian vs. Big Endian?) + memory efficient fast to parse
  3. Cross platform solutions are text based + human readable (okay, xml...) + platform independend (but: still encoding problems!) + format can evolve (e.g. additional fields in xml ) waste more memory slow to parse
  4. From http://www.yegor256.com/2015/11/16/json-vs-xml.html  I believe there are four features XML has that seriously set it apart from JSON or any other simple data format, like YAML for example. XPath. To get data like the year of publication from the document above, I just send an XPath query: /book/published/year/text(). However, there has to be an XPath processor that understands my request and returns 2004. The beauty of this is that XPath 2.0 is a very powerful query engine with its own functions, predicates, axes, etc. You can literally put any logic into your XPath request without writing any traversing logic in Java, for example. You may ask "How many books were published by David West in 2004?" and get an answer, just via XPath. JSON is not even close to this. Attributes and Namespaces. You can attach metadata to your data, just like it's done above with the id attribute. The data stays inside elements, just like the name of the book author, for example, while metadata (data about data) can and should be placed into attributes. This significantly helps in organizing and structuring information. On top of that, both elements and attributes can be marked as belonging to certain namespaces. This is a very useful technique during times when a few applications are working with the same XML document. XML Schema. When you create an XML document in one place, modify it a few times somewhere else, and then transfer it to yet another place, you want to make sure its structure is not broken by any of these actions. One of them may use <year> to store the publication date while another uses <date> with ISO-8601. To avoid that mess in structure, create a supplementary document, which is called XML Schema, and ship it together with the main document. Everyone who wants to work with the main document will first validate its correctness using the schema supplied. This is a sort of integration testing in production. RelaxNG is a similar but simpler mechanism; give it a try if you find XML Schema too complex. XSL. You can make modifications to your XML document without any Java/Ruby/etc. code at all. Just create an XSL transformation document and "apply" it to your original XML. As an output, you will get a new XML. The XSL language (it is purely functional, by the way) is designed for hierarchical data manipulations. It is much more suitable for this task than Java or any other OOP/procedural approach. You can transform an XML document into anything, including plain text andHTML. Some complain about XSL's complexity, but please give it a try. You won't need all of it, while its core functionality is pretty straight-forward. From http://apigee.com/about/blog/technology/why-xml-wont-die-xml-vs-json-your-api JSON is especially good at representing programming-language objects. If you have a JavaScript or Java object, or even a C struct, the structure of the object and all its fields can be easily and quickly converted to JSON, sent over a network, and retrieved on the other end without too much difficulty and (usually) comes out the same on both ends. But not everything in the world is a programming-language object. Sometimes to describe a complex real-world object we have to combine different descriptions and languages from different places, mash them up, and use them to describe even more complex things. The descriptions of these complex things need to be validated, they need to be commented on, they need to be shared and sometimes annotated with additional data that doesn't affect the original structure. When the world gets complicated and open-ended like that, what's needed is not a programming-language-format object, but a open-ended, extensible -- umm -- markup language. That's what we have today with XML.
  5. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  6. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  7. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  8. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  9. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  10. https://opensource.googleblog.com/2008/07/protocol-buffers-googles-data.html
  11. Kodu goster
  12. Kodu goster
  13. http://www.slideshare.net/SergeyPodolsky/google-protocol-buffers-56085699