SlideShare a Scribd company logo
DATA SERIALIZATION WITH
GOOGLE PROTOCOL BUFFERS
By: William Kibira
What is Data Serialization
● The process of translating a data structure and
its object state into a format that can be stored
in a memory buffer, file or transported on a
network.
● End goal being that it can be reconstructed in
another computer environment.
Reasons as To why We do this
● Persist Objects [Store and later Retrieve them]
● Perform Remote Procedural Calls
● Create Distributed Objects [Corba , JavaRMI,
ICE]
Key Words
● Computer Environment
- Programming Languages
- Operating Systems
- Architectures and processors
● Platform Independent Solutions
Popular Platform Independent
Solutions
● JSON and XML
● BSON and Binary XML
● Google Protocol Buffer , Thrift , Avro
Ref
http://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats
JSON AND XML
● Most popular
● Easily Human Readable to some extent
● Most Web based APIs use it by default
● Lots of generators for this stuff
How to works
● You write an IDL [Interface Description
Language] . Kinda like CORBA IDLs but ,
much cleaner and more flexible.
● Pass it through a C++ based code generator
● Get your Boiler plate code in a given language
you specified
GOOGLE PROTOCOL BUFFERS
● This is a platform independent language
independent data serialization solution similar
to XML in structure but much smaller in size
and easier to structure .
● Been there since 2001 , made open in 2008
JSON BINARY FORMATS
● JSON is darn easy to read , If you can read binary , you definitely
need to see a doctor.
● JSON [Gets fat even on little Data], Binary really compact
{"deposit_money": "12345678"}
JSON BINARY
'0x6d', '0x6f', '0x6e', '0x01', '0xBC614E'
'0x65', '0x79', '0x31',
'0x32', '0x33', '0x34',
'0x35', '0x36', '0x37',
'0x38'
SPEED AT PARSING
● JSON is Fairly fast but , Binary is close to
machine speed since it is readily parse-able.
FLOW
Schema / IDL
C++ Code Generator
C++ JAVA Python JavaScript
Server /Client application bases
What does a Schema Look Like ?
Howto Generate the Code
● Use the protobuffer compiler by specifying the
language you want out put and the file.proto
● Protoc -I=/DIR_to_Schema/
--out_language=FOLDER_TO_Buffer/
DIR_TO_Schema/file.proto
A Look in my Terminal
What is Inside My XX.java
SIZE COMPARISON
RMI
GPB
JSON
XML
0 100 200 300 400 500 600 700 800 900 1000
905
250
559
836
Runtime Performance
Server CPU AVG Client CPU AVG Time
Protobuf 30.0% 37.75% 01:19:48
JSON 20.0% 75.00% 04:44:83
XML 12.00 80.75% 05:27:45
Versioning
● This is to do with backward compatibility
between Protocol buffers that are old or new
● Old server new Client and Vice Versa
Even if a field has changed , the data will be
parsed
Other Protocol Buffers
● MessagePack [.Net]
● Thrift [Facebook]
● Avro
Reasons To use Protocol Buffers
● They are smaller to push around over
networks
● Easier [If Not easiest] to structure
● Give a sense object oriented structuring
Reasons Not To use it
● Well, you will have to maintain both the server
and clients .
● They may in most cases not be easy to learn
● They are not an industry standard.
● I am just trying to be fair here :)
SIMPLE DEMO CHAT APPS
● Simple chat application working on both
desktops, laptops and Also on different
Operating systems
● Partial Inspiration from the Fifth Estate
THE END
● Links to Check out
Google Protocol Buffers Main Page
https://developers.google.com/protocol-buffers/
● Apache Thrift
https://thrift.apache.org/

More Related Content

What's hot (19)

PDF
Beyond JSON - An Introduction to FlatBuffers
Maxim Zaks
 
PPTX
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
PDF
3 apache-avro
zafargilani
 
PPTX
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Chicago Hadoop Users Group
 
PDF
CBOR - The Better JSON
Christoph Engelbert
 
PPTX
Facebook thrift
Priyadarshi Raj
 
PDF
Apache thrift-RPC service cross languages
Jimmy Lai
 
PPTX
Apache Avro and Messaging at Scale in LivePerson
LivePerson
 
PPTX
Apache Thrift, a brief introduction
Randy Abernethy
 
PDF
Apache AVRO (Boston HUG, Jan 19, 2010)
Cloudera, Inc.
 
PPTX
Rockin' Protobuf in Ruby
BJ Neilsen
 
PDF
Apache Thrift : One Stop Solution for Cross Language Communication
Piyush Goel
 
PDF
Apache Thrift
knight1128
 
PPTX
Parsing XML & JSON in Apex
Abhinav Gupta
 
PDF
Python 45 minutes hangout #3
Al Sayed Gamal
 
PPTX
JSON Support in Salesforce - winter 12
Jitendra Zaa
 
PDF
Python and Zope: An introduction (May 2004)
Kiran Jonnalagadda
 
PPT
7 streams and error handling in java
Jyoti Verma
 
Beyond JSON - An Introduction to FlatBuffers
Maxim Zaks
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Igor Anishchenko
 
3 apache-avro
zafargilani
 
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Chicago Hadoop Users Group
 
CBOR - The Better JSON
Christoph Engelbert
 
Facebook thrift
Priyadarshi Raj
 
Apache thrift-RPC service cross languages
Jimmy Lai
 
Apache Avro and Messaging at Scale in LivePerson
LivePerson
 
Apache Thrift, a brief introduction
Randy Abernethy
 
Apache AVRO (Boston HUG, Jan 19, 2010)
Cloudera, Inc.
 
Rockin' Protobuf in Ruby
BJ Neilsen
 
Apache Thrift : One Stop Solution for Cross Language Communication
Piyush Goel
 
Apache Thrift
knight1128
 
Parsing XML & JSON in Apex
Abhinav Gupta
 
Python 45 minutes hangout #3
Al Sayed Gamal
 
JSON Support in Salesforce - winter 12
Jitendra Zaa
 
Python and Zope: An introduction (May 2004)
Kiran Jonnalagadda
 
7 streams and error handling in java
Jyoti Verma
 

Viewers also liked (18)

PPTX
Protocol buffers
Fabricio Epaminondas
 
PDF
Introduction to protocol buffer
Tim (文昌)
 
PPTX
Avro intro
Randy Abernethy
 
PPTX
Serialization and performance by Sergey Morenets
Alex Tumanoff
 
KEY
Protocol Buffers and Hadoop at Twitter
Kevin Weil
 
PDF
Avro, la puissance du binaire, la souplesse du JSON
Alexandre Victoor
 
PPT
Parquet and impala overview external
mattlieber
 
PDF
Experience protocol buffer on android
Richard Chang
 
PPTX
Avro introduction
Nanda8904648951
 
PDF
An Empirical Evaluation of VoIP Playout Buffer Dimensioning in Skype, Google ...
Academia Sinica
 
PDF
gRPC and Microservices
Jonathan Gomez
 
PDF
RPC protocols
오석 한
 
PDF
Illustration of TextSecure's Protocol Buffer usage
Christine Corbett Moran
 
PPTX
Google QUIC
Felipe Rayel
 
PPTX
Introducing HTTP/2
Ido Flatow
 
PDF
Axolotl Protocol: An Illustrated Primer
Christine Corbett Moran
 
PDF
Parquet and AVRO
airisData
 
PDF
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Shiju Varghese
 
Protocol buffers
Fabricio Epaminondas
 
Introduction to protocol buffer
Tim (文昌)
 
Avro intro
Randy Abernethy
 
Serialization and performance by Sergey Morenets
Alex Tumanoff
 
Protocol Buffers and Hadoop at Twitter
Kevin Weil
 
Avro, la puissance du binaire, la souplesse du JSON
Alexandre Victoor
 
Parquet and impala overview external
mattlieber
 
Experience protocol buffer on android
Richard Chang
 
Avro introduction
Nanda8904648951
 
An Empirical Evaluation of VoIP Playout Buffer Dimensioning in Skype, Google ...
Academia Sinica
 
gRPC and Microservices
Jonathan Gomez
 
RPC protocols
오석 한
 
Illustration of TextSecure's Protocol Buffer usage
Christine Corbett Moran
 
Google QUIC
Felipe Rayel
 
Introducing HTTP/2
Ido Flatow
 
Axolotl Protocol: An Illustrated Primer
Christine Corbett Moran
 
Parquet and AVRO
airisData
 
Building High Performance APIs In Go Using gRPC And Protocol Buffers
Shiju Varghese
 
Ad

Similar to Data Serialization Using Google Protocol Buffers (20)

PPTX
Golang proto buff_ixxo
www.ixxo.io
 
PPTX
Data Encoding in Remote Procedure calls.
kalojo7178
 
PDF
Maxim Zaks: Deep dive into data serialisation
mdevtalk
 
PPTX
Protocol buffers
Manuel Correa
 
PPTX
Сергей Моренец. Serialization and performance in Java
Volha Banadyseva
 
PDF
Building a maintainable bi-directional cross platform protocol
Pavel Dovbush
 
PPTX
Serialization and performance in Java
Strannik_2013
 
PPTX
Google Protocol Buffers + gRPC
Imal hasaranga
 
PDF
Beyond JSON @ Mobile.Warsaw
Maxim Zaks
 
PDF
Teach your (micro)services talk Protocol Buffers with gRPC.
Mihai Iachimovschi
 
PPTX
Protobuff and gRPC
Uraz Pokharel
 
DOCX
82159587 case-study-on-corba
homeworkping3
 
PPT
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Matt O'Keefe
 
PPS
Advance Java
Vidyacenter
 
DOCX
85305524 i-t-case-study
homeworkping3
 
PPTX
Java Serialization Facts and Fallacies
Roman Elizarov
 
PPT
Corba and-java
afreen58
 
PPTX
Big data
Subha Selvam
 
PDF
Data transfering: faster, stronger, better and not harder. UA Mobile 2016.
UA Mobile
 
PDF
Антон Минашкин "Data transfering faster, stronger, better and not harder"
Fwdays
 
Golang proto buff_ixxo
www.ixxo.io
 
Data Encoding in Remote Procedure calls.
kalojo7178
 
Maxim Zaks: Deep dive into data serialisation
mdevtalk
 
Protocol buffers
Manuel Correa
 
Сергей Моренец. Serialization and performance in Java
Volha Banadyseva
 
Building a maintainable bi-directional cross platform protocol
Pavel Dovbush
 
Serialization and performance in Java
Strannik_2013
 
Google Protocol Buffers + gRPC
Imal hasaranga
 
Beyond JSON @ Mobile.Warsaw
Maxim Zaks
 
Teach your (micro)services talk Protocol Buffers with gRPC.
Mihai Iachimovschi
 
Protobuff and gRPC
Uraz Pokharel
 
82159587 case-study-on-corba
homeworkping3
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Matt O'Keefe
 
Advance Java
Vidyacenter
 
85305524 i-t-case-study
homeworkping3
 
Java Serialization Facts and Fallacies
Roman Elizarov
 
Corba and-java
afreen58
 
Big data
Subha Selvam
 
Data transfering: faster, stronger, better and not harder. UA Mobile 2016.
UA Mobile
 
Антон Минашкин "Data transfering faster, stronger, better and not harder"
Fwdays
 
Ad

Recently uploaded (20)

PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 

Data Serialization Using Google Protocol Buffers

  • 1. DATA SERIALIZATION WITH GOOGLE PROTOCOL BUFFERS By: William Kibira
  • 2. What is Data Serialization ● The process of translating a data structure and its object state into a format that can be stored in a memory buffer, file or transported on a network. ● End goal being that it can be reconstructed in another computer environment.
  • 3. Reasons as To why We do this ● Persist Objects [Store and later Retrieve them] ● Perform Remote Procedural Calls ● Create Distributed Objects [Corba , JavaRMI, ICE]
  • 4. Key Words ● Computer Environment - Programming Languages - Operating Systems - Architectures and processors ● Platform Independent Solutions
  • 5. Popular Platform Independent Solutions ● JSON and XML ● BSON and Binary XML ● Google Protocol Buffer , Thrift , Avro Ref http://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats
  • 6. JSON AND XML ● Most popular ● Easily Human Readable to some extent ● Most Web based APIs use it by default ● Lots of generators for this stuff
  • 7. How to works ● You write an IDL [Interface Description Language] . Kinda like CORBA IDLs but , much cleaner and more flexible. ● Pass it through a C++ based code generator ● Get your Boiler plate code in a given language you specified
  • 8. GOOGLE PROTOCOL BUFFERS ● This is a platform independent language independent data serialization solution similar to XML in structure but much smaller in size and easier to structure . ● Been there since 2001 , made open in 2008
  • 9. JSON BINARY FORMATS ● JSON is darn easy to read , If you can read binary , you definitely need to see a doctor. ● JSON [Gets fat even on little Data], Binary really compact {"deposit_money": "12345678"} JSON BINARY '0x6d', '0x6f', '0x6e', '0x01', '0xBC614E' '0x65', '0x79', '0x31', '0x32', '0x33', '0x34', '0x35', '0x36', '0x37', '0x38'
  • 10. SPEED AT PARSING ● JSON is Fairly fast but , Binary is close to machine speed since it is readily parse-able.
  • 11. FLOW Schema / IDL C++ Code Generator C++ JAVA Python JavaScript Server /Client application bases
  • 12. What does a Schema Look Like ?
  • 13. Howto Generate the Code ● Use the protobuffer compiler by specifying the language you want out put and the file.proto ● Protoc -I=/DIR_to_Schema/ --out_language=FOLDER_TO_Buffer/ DIR_TO_Schema/file.proto
  • 14. A Look in my Terminal
  • 15. What is Inside My XX.java
  • 16. SIZE COMPARISON RMI GPB JSON XML 0 100 200 300 400 500 600 700 800 900 1000 905 250 559 836
  • 17. Runtime Performance Server CPU AVG Client CPU AVG Time Protobuf 30.0% 37.75% 01:19:48 JSON 20.0% 75.00% 04:44:83 XML 12.00 80.75% 05:27:45
  • 18. Versioning ● This is to do with backward compatibility between Protocol buffers that are old or new ● Old server new Client and Vice Versa Even if a field has changed , the data will be parsed
  • 19. Other Protocol Buffers ● MessagePack [.Net] ● Thrift [Facebook] ● Avro
  • 20. Reasons To use Protocol Buffers ● They are smaller to push around over networks ● Easier [If Not easiest] to structure ● Give a sense object oriented structuring
  • 21. Reasons Not To use it ● Well, you will have to maintain both the server and clients . ● They may in most cases not be easy to learn ● They are not an industry standard. ● I am just trying to be fair here :)
  • 22. SIMPLE DEMO CHAT APPS ● Simple chat application working on both desktops, laptops and Also on different Operating systems ● Partial Inspiration from the Fifth Estate
  • 23. THE END ● Links to Check out Google Protocol Buffers Main Page https://developers.google.com/protocol-buffers/ ● Apache Thrift https://thrift.apache.org/