SlideShare a Scribd company logo
1 of 19
gRPC
14 July 2021
Majid Alaeinia
2
History
- gRPC First Release Date: August 2016
- Developed by: Google
- Stubby connect large number of microservices running within and across its
data centers for over a decade.
- In March 2015, Google decided to build the next version of Stubby and make it
open source.
- Now it is used on organization outside the google to power use cases from
microservices to the “last mile” of computing (mobile, web, and Internet of
Things)
- Google, Square, Netflix, CoreOs, CockroachDB, Cisco, Juniper
3
Http/1.1 vs Http/2
- The first usable version of HTTP was created in 1997.
- In 2015 a new version of HTTP called HTTP/2 was created.
- HTTP/2 solves several problems that the creators of HTTP/1.1 did not
anticipate.
- Much faster and more efficient
- Prioritizing content during the loading process
- Multiplexing
- Server Push
- Header Compression
4
Stub
- A stub in distributed computing is a piece of code that converts parameters
passed between client and server during a remote procedure call (RPC).
- Stubs can be generated in one of two ways:
- Manually
- Automatically
5
gRPC Overview
Supported Languages:
- C#
- C++
- Dart
- Go
- Java
- Kotlin
- Node
- Objective-C
- PHP
- Python
- Ruby
6
The main usage scenarios
- Efficiently connecting polyglot services in microservices style architecture
- Connecting mobile devices, browser clients to backend services
7
Core features that make it awesome
- Idiomatic client libraries in 10 languages
- Highly efficient with a simple service definition framework
- Bi-directional streaming with http/2 based transport
- Pluggable auth, tracing, load balancing and health checking
8
gRPC vs REST
Comparison Parameter REST gRPC
Protocol HTTP/1.1 (slow) HTTP/2 (fast)
Payload JSON (text, large) Protobuf (binary, small)
API contract Loose, optional (OPEN API) Strict, required (.proto)
Code generation Third-Party tools (Swagger) Built-in (protc)
Security TLS/SSL TLS/SSL
Streaming Client-Server requests only Bidirectional streaming
Browser Support Yes Limited (require grpc-web)
Community Large Small
Coupling Loosely coupled Tightly coupled
9
gRPC vs REST
Advantages of REST
- Easy to understand.
- Tools for in inspection, modification, testing are readily available.
- Loose coupling between client and server makes changes relatively easy.
- There are lots of frameworks in most of the widely used languages to create
REST Api’s.
10
gRPC vs REST
Pain Points of REST
- Streaming is difficult and it’s highly impossible in most of the languages.
- Duplex streaming is not possible.
- Hard to get multiple resources in single request.
- Need semantic versioning whenever the api contract needs to be changed.
11
gRPC vs REST
Advantages of gRPC
- Language agnostic - High performance along with
Safety
- Provides Generators to Serialize or Deserialize - First Class Load Balancing
- Supports types and Validations - Selective message
compression
- Lesser Boilerplate code - Heavily optimized
12
gRPC vs REST
Pain Points of gRPC
- No support for browsers hence cannot be used for external services.
- No url end points hence can’t be tested with postman or curl to check the
response.
- No predefined status codes and creating custom status code may end up in
conflicts.
13
When to Use gRPC
- When the microservices is only internal and when one server needs to talk to the
other.
- When your internal services requires duplex streaming with high load of data.
14
Service Methods in gRPC
1. Unary RPCs where the client sends a single request to the server and gets
a single response back, just like a normal function call.
15
Service Methods in gRPC
2. Server streaming RPCs where the client sends a request to the server and
gets a stream to read a sequence of messages back. The client reads from
the returned stream until there are no more messages. gRPC guarantees
message ordering within an individual RPC call.
16
Service Methods in gRPC
3. Client streaming RPCs where the client writes a sequence of messages and
sends them to the server, again using a provided stream. Once the client has
finished writing the messages, it waits for the server to read them and return
its response. Again gRPC guarantees message ordering within an individual
RPC call.
17
Service Methods in gRPC
4. Bidirectional streaming RPCs where both sides send a sequence of
messages using a read-write stream. The two streams operate independently,
so clients and servers can read and write in whatever order they like: for
example, the server could wait to receive all the client messages before
writing its responses, or it could alternately read a message then write a
message, or some other combination of reads and writes. The order of
messages in each stream is preserved.
18
Synchronous vs. asynchronous
Synchronous RPC calls that block until a response arrives from the server
are the closest approximation to the abstraction of a procedure call that RPC
aspires to. On the other hand, networks are inherently asynchronous and in
many scenarios it’s useful to be able to start RPCs without blocking the
current thread.
The gRPC programming API in most languages comes in both synchronous
and asynchronous flavors. You can find out more in each language’s tutorial
and reference documentation (complete reference docs are coming soon).
19
How about an example?
https://github.com/MajidAlaeinia/grpc-go-client-server-playground

More Related Content

What's hot

Inter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPCInter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPCShiju Varghese
 
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'sLuram Archanjo
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and MicroservicesJonathan Gomez
 
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...AboutYouGmbH
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPCGuo Jing
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Codemotion
 
Building Microservices with gRPC and NATS
Building Microservices with gRPC and NATSBuilding Microservices with gRPC and NATS
Building Microservices with gRPC and NATSShiju Varghese
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!Alex Borysov
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC ServiceJessie Barnett
 
Cilium - Network security for microservices
Cilium - Network security for microservicesCilium - Network security for microservices
Cilium - Network security for microservicesThomas Graf
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDPDaniel T. Lee
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Weaveworks
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 

What's hot (20)

GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Inter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPCInter-Process Communication in Microservices using gRPC
Inter-Process Communication in Microservices using gRPC
 
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
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
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...
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
 
Building Microservices with gRPC and NATS
Building Microservices with gRPC and NATSBuilding Microservices with gRPC and NATS
Building Microservices with gRPC and NATS
 
gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!gRPC vs REST: let the battle begin!
gRPC vs REST: let the battle begin!
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
Protocol Buffers
Protocol BuffersProtocol Buffers
Protocol Buffers
 
DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Cilium - Network security for microservices
Cilium - Network security for microservicesCilium - Network security for microservices
Cilium - Network security for microservices
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
AMQP
AMQPAMQP
AMQP
 

Similar to gRPC

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stackLuca Mattia Ferrari
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explainedjeetendra mandal
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31Varun Talwar
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleAmbassador Labs
 
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...Tien Nguyen
 
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Mustafa AKIN
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangOmidHojabri1
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Md. Sadhan Sarker
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!QAware GmbH
 
Building API Using GRPC And Scala
Building API Using GRPC And ScalaBuilding API Using GRPC And Scala
Building API Using GRPC And ScalaKnoldus Inc.
 
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021StreamNative
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolSougata Pal
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsTim Burks
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!QAware GmbH
 
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...apidays
 

Similar to gRPC (20)

The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
What is gRPC introduction gRPC Explained
What is gRPC introduction gRPC ExplainedWhat is gRPC introduction gRPC Explained
What is gRPC introduction gRPC Explained
 
Microservices summit talk 1/31
Microservices summit talk   1/31Microservices summit talk   1/31
Microservices summit talk 1/31
 
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, GoogleBringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
Bringing Learnings from Googley Microservices with gRPC - Varun Talwar, Google
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
SignalR or gRPC: Choosing the Right Technology for Real-Time Communication in...
 
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
 
Apa itu gRPC_.pptx
Apa itu gRPC_.pptxApa itu gRPC_.pptx
Apa itu gRPC_.pptx
 
Modern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in GolangModern webservices using gRPC and Protocol Buffers in Golang
Modern webservices using gRPC and Protocol Buffers in Golang
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
Building API Using GRPC And Scala
Building API Using GRPC And ScalaBuilding API Using GRPC And Scala
Building API Using GRPC And Scala
 
gRPC services testing
gRPC services testinggRPC services testing
gRPC services testing
 
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021
Deep Dive into the Pulsar Binary Protocol - Pulsar Virtual Summit Europe 2021
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 

gRPC

  • 2. 2 History - gRPC First Release Date: August 2016 - Developed by: Google - Stubby connect large number of microservices running within and across its data centers for over a decade. - In March 2015, Google decided to build the next version of Stubby and make it open source. - Now it is used on organization outside the google to power use cases from microservices to the “last mile” of computing (mobile, web, and Internet of Things) - Google, Square, Netflix, CoreOs, CockroachDB, Cisco, Juniper
  • 3. 3 Http/1.1 vs Http/2 - The first usable version of HTTP was created in 1997. - In 2015 a new version of HTTP called HTTP/2 was created. - HTTP/2 solves several problems that the creators of HTTP/1.1 did not anticipate. - Much faster and more efficient - Prioritizing content during the loading process - Multiplexing - Server Push - Header Compression
  • 4. 4 Stub - A stub in distributed computing is a piece of code that converts parameters passed between client and server during a remote procedure call (RPC). - Stubs can be generated in one of two ways: - Manually - Automatically
  • 5. 5 gRPC Overview Supported Languages: - C# - C++ - Dart - Go - Java - Kotlin - Node - Objective-C - PHP - Python - Ruby
  • 6. 6 The main usage scenarios - Efficiently connecting polyglot services in microservices style architecture - Connecting mobile devices, browser clients to backend services
  • 7. 7 Core features that make it awesome - Idiomatic client libraries in 10 languages - Highly efficient with a simple service definition framework - Bi-directional streaming with http/2 based transport - Pluggable auth, tracing, load balancing and health checking
  • 8. 8 gRPC vs REST Comparison Parameter REST gRPC Protocol HTTP/1.1 (slow) HTTP/2 (fast) Payload JSON (text, large) Protobuf (binary, small) API contract Loose, optional (OPEN API) Strict, required (.proto) Code generation Third-Party tools (Swagger) Built-in (protc) Security TLS/SSL TLS/SSL Streaming Client-Server requests only Bidirectional streaming Browser Support Yes Limited (require grpc-web) Community Large Small Coupling Loosely coupled Tightly coupled
  • 9. 9 gRPC vs REST Advantages of REST - Easy to understand. - Tools for in inspection, modification, testing are readily available. - Loose coupling between client and server makes changes relatively easy. - There are lots of frameworks in most of the widely used languages to create REST Api’s.
  • 10. 10 gRPC vs REST Pain Points of REST - Streaming is difficult and it’s highly impossible in most of the languages. - Duplex streaming is not possible. - Hard to get multiple resources in single request. - Need semantic versioning whenever the api contract needs to be changed.
  • 11. 11 gRPC vs REST Advantages of gRPC - Language agnostic - High performance along with Safety - Provides Generators to Serialize or Deserialize - First Class Load Balancing - Supports types and Validations - Selective message compression - Lesser Boilerplate code - Heavily optimized
  • 12. 12 gRPC vs REST Pain Points of gRPC - No support for browsers hence cannot be used for external services. - No url end points hence can’t be tested with postman or curl to check the response. - No predefined status codes and creating custom status code may end up in conflicts.
  • 13. 13 When to Use gRPC - When the microservices is only internal and when one server needs to talk to the other. - When your internal services requires duplex streaming with high load of data.
  • 14. 14 Service Methods in gRPC 1. Unary RPCs where the client sends a single request to the server and gets a single response back, just like a normal function call.
  • 15. 15 Service Methods in gRPC 2. Server streaming RPCs where the client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are no more messages. gRPC guarantees message ordering within an individual RPC call.
  • 16. 16 Service Methods in gRPC 3. Client streaming RPCs where the client writes a sequence of messages and sends them to the server, again using a provided stream. Once the client has finished writing the messages, it waits for the server to read them and return its response. Again gRPC guarantees message ordering within an individual RPC call.
  • 17. 17 Service Methods in gRPC 4. Bidirectional streaming RPCs where both sides send a sequence of messages using a read-write stream. The two streams operate independently, so clients and servers can read and write in whatever order they like: for example, the server could wait to receive all the client messages before writing its responses, or it could alternately read a message then write a message, or some other combination of reads and writes. The order of messages in each stream is preserved.
  • 18. 18 Synchronous vs. asynchronous Synchronous RPC calls that block until a response arrives from the server are the closest approximation to the abstraction of a procedure call that RPC aspires to. On the other hand, networks are inherently asynchronous and in many scenarios it’s useful to be able to start RPCs without blocking the current thread. The gRPC programming API in most languages comes in both synchronous and asynchronous flavors. You can find out more in each language’s tutorial and reference documentation (complete reference docs are coming soon).
  • 19. 19 How about an example? https://github.com/MajidAlaeinia/grpc-go-client-server-playground