際際滷

際際滷Share a Scribd company logo
Protocol Buffer & gRPC
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.
Protocol buffers
 Protocol buffers are a flexible, efficient, automated mechanism for serializing structured
data and its
 Language-neutral
 Platform-neutral
 Extensible
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
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
 Cant open the serialized data with the text editor
Structure message Person {
string first_name = 1;
string last_name = 2;
int32 age = 3;
}
HTTP 1.1 vs HTTP/2
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.
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
Protobuff and gRPC
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
Protobuff and gRPC
Protobuff and gRPC

More Related Content

Similar to Protobuff and gRPC (20)

Hadoop Ecosystem and Low Latency Streaming Architecture
Hadoop Ecosystem and Low Latency Streaming ArchitectureHadoop Ecosystem and Low Latency Streaming Architecture
Hadoop Ecosystem and Low Latency Streaming Architecture
InSemble
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
Abhishek Sagar
Hpc lunch and learn
Hpc lunch and learnHpc lunch and learn
Hpc lunch and learn
John D Almon
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
mindhackers161
Data Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. PickleData Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. Pickle
Inexture Solutions
Unit 1 web technology uptu slide
Unit 1 web technology uptu slideUnit 1 web technology uptu slide
Unit 1 web technology uptu slide
Abhishek Kesharwani
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
BIOVIA
Common crawlpresentation
Common crawlpresentationCommon crawlpresentation
Common crawlpresentation
Hadoop User Group
Building a Scalable Web Crawler with Hadoop
Building a Scalable Web Crawler with HadoopBuilding a Scalable Web Crawler with Hadoop
Building a Scalable Web Crawler with Hadoop
Hadoop User Group
IT-NET GROUP 3 REPORT.pptx
IT-NET GROUP 3 REPORT.pptxIT-NET GROUP 3 REPORT.pptx
IT-NET GROUP 3 REPORT.pptx
EdJulleza
Application Layer
Application LayerApplication Layer
Application Layer
ushabarad142
Viloria osi layer4-7
Viloria osi layer4-7Viloria osi layer4-7
Viloria osi layer4-7
Jhoniel Viloria
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
jimriecken
MODULE-5_CCN.pptx
MODULE-5_CCN.pptxMODULE-5_CCN.pptx
MODULE-5_CCN.pptx
Dr. Shivashankar
Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpoint
Christopher Dubois
Computer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdfComputer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdf
ShanthalaKV
[Distributed System] ch4. interprocess communication
[Distributed System] ch4. interprocess communication[Distributed System] ch4. interprocess communication
[Distributed System] ch4. interprocess communication
Gyuhyeon Nam
RPC in Smalltalk
 RPC in Smalltalk RPC in Smalltalk
RPC in Smalltalk
ESUG
Mcroservices with docker kubernetes, goang and grpc, overview
Mcroservices with docker kubernetes, goang and grpc, overviewMcroservices with docker kubernetes, goang and grpc, overview
Mcroservices with docker kubernetes, goang and grpc, overview
Faculty of Technical Sciences, University of Novi Sad
Hadoop Ecosystem and Low Latency Streaming Architecture
Hadoop Ecosystem and Low Latency Streaming ArchitectureHadoop Ecosystem and Low Latency Streaming Architecture
Hadoop Ecosystem and Low Latency Streaming Architecture
InSemble
Modern Distributed Messaging and RPC
Modern Distributed Messaging and RPCModern Distributed Messaging and RPC
Modern Distributed Messaging and RPC
Max Alexejev
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
Abhishek Sagar
Hpc lunch and learn
Hpc lunch and learnHpc lunch and learn
Hpc lunch and learn
John D Almon
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
403983283sdsadsadsadasdsda-CCNA-PPT-pptx.pptx
mindhackers161
Data Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. PickleData Serialization in Python JSON vs. Pickle
Data Serialization in Python JSON vs. Pickle
Inexture Solutions
Unit 1 web technology uptu slide
Unit 1 web technology uptu slideUnit 1 web technology uptu slide
Unit 1 web technology uptu slide
Abhishek Kesharwani
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
(ATS3-DEV04) Introduction to Pipeline Pilot Protocol Development for Developers
BIOVIA
Building a Scalable Web Crawler with Hadoop
Building a Scalable Web Crawler with HadoopBuilding a Scalable Web Crawler with Hadoop
Building a Scalable Web Crawler with Hadoop
Hadoop User Group
IT-NET GROUP 3 REPORT.pptx
IT-NET GROUP 3 REPORT.pptxIT-NET GROUP 3 REPORT.pptx
IT-NET GROUP 3 REPORT.pptx
EdJulleza
Application Layer
Application LayerApplication Layer
Application Layer
ushabarad142
Building an Event Bus at Scale
Building an Event Bus at ScaleBuilding an Event Bus at Scale
Building an Event Bus at Scale
jimriecken
Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpoint
Christopher Dubois
Computer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdfComputer Networks Module 1-part 1.pdf
Computer Networks Module 1-part 1.pdf
ShanthalaKV
[Distributed System] ch4. interprocess communication
[Distributed System] ch4. interprocess communication[Distributed System] ch4. interprocess communication
[Distributed System] ch4. interprocess communication
Gyuhyeon Nam
RPC in Smalltalk
 RPC in Smalltalk RPC in Smalltalk
RPC in Smalltalk
ESUG

Recently uploaded (20)

"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest..."Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
Fwdays
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Charles Martin
Cloud Computing The Future of Technology
Cloud Computing The Future of TechnologyCloud Computing The Future of Technology
Cloud Computing The Future of Technology
joelmcapg
Women in Automation: Career Development & Leadership in Automation
Women in Automation: Career Development & Leadership in AutomationWomen in Automation: Career Development & Leadership in Automation
Women in Automation: Career Development & Leadership in Automation
UiPathCommunity
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea..."AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
Fwdays
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem..."Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
Fwdays
Google News Consideration for SEO | Google Search NYC
Google News Consideration for SEO | Google Search NYCGoogle News Consideration for SEO | Google Search NYC
Google News Consideration for SEO | Google Search NYC
Primary Position
Columbia Weather Systems - Product Overview
Columbia Weather Systems - Product OverviewColumbia Weather Systems - Product Overview
Columbia Weather Systems - Product Overview
Columbia Weather Systems
Best Crane Manufacturers in India Industry Leaders & Innovations.pdf
Best Crane Manufacturers in India Industry Leaders & Innovations.pdfBest Crane Manufacturers in India Industry Leaders & Innovations.pdf
Best Crane Manufacturers in India Industry Leaders & Innovations.pdf
Hercules Hoists
"Constructive Interaction During Emotional Burnout: With Local and Internatio...
"Constructive Interaction During Emotional Burnout: With Local and Internatio..."Constructive Interaction During Emotional Burnout: With Local and Internatio...
"Constructive Interaction During Emotional Burnout: With Local and Internatio...
Fwdays
Digital Twins Transforming Logistics with AI & Cloud
Digital Twins  Transforming Logistics  with AI & CloudDigital Twins  Transforming Logistics  with AI & Cloud
Digital Twins Transforming Logistics with AI & Cloud
yashakhandelwal2
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptxCSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
ystein Moseng
Emancipatory Information Retrieval (Invited Talk at UCC)
Emancipatory Information Retrieval (Invited Talk at UCC)Emancipatory Information Retrieval (Invited Talk at UCC)
Emancipatory Information Retrieval (Invited Talk at UCC)
Bhaskar Mitra
The nature of technolog and Computer networks.pptx
The nature of technolog and Computer networks.pptxThe nature of technolog and Computer networks.pptx
The nature of technolog and Computer networks.pptx
vallidevi6
STIG in Action: Continuous Compliance with MITRE & Anchore
STIG in Action: Continuous Compliance with MITRE & AnchoreSTIG in Action: Continuous Compliance with MITRE & Anchore
STIG in Action: Continuous Compliance with MITRE & Anchore
Anchore
Benefits of Using Ultrasonic Level Transmitters for Control
Benefits of Using Ultrasonic Level Transmitters for ControlBenefits of Using Ultrasonic Level Transmitters for Control
Benefits of Using Ultrasonic Level Transmitters for Control
nikeson80
Software-Engineering-and-Best-Practices.
Software-Engineering-and-Best-Practices.Software-Engineering-and-Best-Practices.
Software-Engineering-and-Best-Practices.
oziasrondonc
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Safe Software
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest..."Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...
Fwdays
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Spin Glass Models of Neural Networks: The Curie-Weiss Model from Statistical ...
Charles Martin
Cloud Computing The Future of Technology
Cloud Computing The Future of TechnologyCloud Computing The Future of Technology
Cloud Computing The Future of Technology
joelmcapg
Women in Automation: Career Development & Leadership in Automation
Women in Automation: Career Development & Leadership in AutomationWomen in Automation: Career Development & Leadership in Automation
Women in Automation: Career Development & Leadership in Automation
UiPathCommunity
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea..."AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...
Fwdays
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem..."Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...
Fwdays
Google News Consideration for SEO | Google Search NYC
Google News Consideration for SEO | Google Search NYCGoogle News Consideration for SEO | Google Search NYC
Google News Consideration for SEO | Google Search NYC
Primary Position
Columbia Weather Systems - Product Overview
Columbia Weather Systems - Product OverviewColumbia Weather Systems - Product Overview
Columbia Weather Systems - Product Overview
Columbia Weather Systems
Best Crane Manufacturers in India Industry Leaders & Innovations.pdf
Best Crane Manufacturers in India Industry Leaders & Innovations.pdfBest Crane Manufacturers in India Industry Leaders & Innovations.pdf
Best Crane Manufacturers in India Industry Leaders & Innovations.pdf
Hercules Hoists
"Constructive Interaction During Emotional Burnout: With Local and Internatio...
"Constructive Interaction During Emotional Burnout: With Local and Internatio..."Constructive Interaction During Emotional Burnout: With Local and Internatio...
"Constructive Interaction During Emotional Burnout: With Local and Internatio...
Fwdays
Digital Twins Transforming Logistics with AI & Cloud
Digital Twins  Transforming Logistics  with AI & CloudDigital Twins  Transforming Logistics  with AI & Cloud
Digital Twins Transforming Logistics with AI & Cloud
yashakhandelwal2
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptxCSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
CSUN 2025 - Personalization of Accessible Charts and Graphs.pptx
ystein Moseng
Emancipatory Information Retrieval (Invited Talk at UCC)
Emancipatory Information Retrieval (Invited Talk at UCC)Emancipatory Information Retrieval (Invited Talk at UCC)
Emancipatory Information Retrieval (Invited Talk at UCC)
Bhaskar Mitra
The nature of technolog and Computer networks.pptx
The nature of technolog and Computer networks.pptxThe nature of technolog and Computer networks.pptx
The nature of technolog and Computer networks.pptx
vallidevi6
STIG in Action: Continuous Compliance with MITRE & Anchore
STIG in Action: Continuous Compliance with MITRE & AnchoreSTIG in Action: Continuous Compliance with MITRE & Anchore
STIG in Action: Continuous Compliance with MITRE & Anchore
Anchore
Benefits of Using Ultrasonic Level Transmitters for Control
Benefits of Using Ultrasonic Level Transmitters for ControlBenefits of Using Ultrasonic Level Transmitters for Control
Benefits of Using Ultrasonic Level Transmitters for Control
nikeson80
Software-Engineering-and-Best-Practices.
Software-Engineering-and-Best-Practices.Software-Engineering-and-Best-Practices.
Software-Engineering-and-Best-Practices.
oziasrondonc
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Powering Energy and Utilities with Data Integration: Smarter Data, Smoother O...
Safe Software
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2

Protobuff and gRPC

  • 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 Cant open the serialized data with the text editor
  • 6. Structure message Person { string first_name = 1; string last_name = 2; int32 age = 3; }
  • 7. HTTP 1.1 vs HTTP/2
  • 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
  • 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