Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Introduction To
gRPC
Presented by – Akshit Kumar
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
 Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
 Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
 Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
 Avoid Disturbance
Avoid unwanted chit chat during the session.
1. What is gRPC?
2. Protocol Buffers?
3. Flow of Protocol Buffer
4. Why gRPC uses protocol buffer and not JSON?
5. Why gRPC uses HTTP/2 and not HTTP/1
6. Types of gRPC API
7. GRPC vs REST
8. Demo and Q&A
01
What is gRPC?
 Remote Procedure Call (RPC) framework.
 In gRPC, a client application can directly call a method on a server application on a different
machine as if it were a local object.
 Client and Server can be developed using different languages.
02
Protocol Buffers
 gRPC uses Protocol Buffers, Googles's mature open-source mechanism for serializing structured
data (Service, Request, Response).
 gRPC can use protocol buffers as both Interface Definition Language (IDL) and as its underlying
message interchange format.
 It is stored in a file named as .proto
03
Flow of Protocol Buffer
Proto Request
Proto Response
04
Why gRPC uses Protocol Buffer instead of JSON?
 Protocol buffer is smaller in size as compared to JSON.
 Parsing JSON is usually CPU intensive, as it is plain text.
 Parsing Protocol Buffer is less CPU intensive, as it is binary and thus closer to how
machine represents data.
 Faster and efficient communication.
05
Why gRPC uses HTTP/2 instead of HTTP/1?
 Let's see how HTTP/1 works so that we can understand the advantages more clearly.
Why gRPC uses HTTP/2 instead of HTTP/1?
Why gRPC uses HTTP/2 instead of HTTP/1?
 HTTP/1 loads resources one after the other, so if one resource is not loaded, it blocks all other
resources behind it. This causes Head-of-Line blocking.
 In HTTP/1, headers are not compressed and are sent / received with every request.
Let's look at HTTP/2
All about HTTP/2
 Multiplexing: HTTP/2 can use a single TCP connection to send multiple streams (each stream
has an identifier) of data at once so that no resource blocks any other resource.
 HTTP/2 can compress the headers along with the messages; It also uses a more
advanced compression method called HPACK that eliminates redundant information in HTTP
header packets.
 Server Push: Generally, a server only serves content ti a client if the client asks for it, but modern
webpages involve several dozen separate resources that the client must request. HTTP/2 solves
this problem by allowing server to "push" content to a client before the client asks for it.
 Let's see a difference between HTTP/2 and HTTP/1.
https://imagekit.io/demo/http2-vs-http1
06
Types of gRPC API
 There are 4 types of gRPC APIs
07
gRPC vs REST
Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)
Introduction to gRPC Presentation (Java)

More Related Content

Introduction to gRPC Presentation (Java)

  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes  Punctuality Join the session 5 minutes prior to the session start time. We start on time and conclude on time!  Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter.  Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call.  Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 1. What is gRPC? 2. Protocol Buffers? 3. Flow of Protocol Buffer 4. Why gRPC uses protocol buffer and not JSON? 5. Why gRPC uses HTTP/2 and not HTTP/1 6. Types of gRPC API 7. GRPC vs REST 8. Demo and Q&A
  • 4. 01
  • 5. What is gRPC?  Remote Procedure Call (RPC) framework.  In gRPC, a client application can directly call a method on a server application on a different machine as if it were a local object.  Client and Server can be developed using different languages.
  • 6. 02
  • 7. Protocol Buffers  gRPC uses Protocol Buffers, Googles's mature open-source mechanism for serializing structured data (Service, Request, Response).  gRPC can use protocol buffers as both Interface Definition Language (IDL) and as its underlying message interchange format.  It is stored in a file named as .proto
  • 8. 03
  • 9. Flow of Protocol Buffer Proto Request Proto Response
  • 10. 04
  • 11. Why gRPC uses Protocol Buffer instead of JSON?  Protocol buffer is smaller in size as compared to JSON.  Parsing JSON is usually CPU intensive, as it is plain text.  Parsing Protocol Buffer is less CPU intensive, as it is binary and thus closer to how machine represents data.  Faster and efficient communication.
  • 12. 05
  • 13. Why gRPC uses HTTP/2 instead of HTTP/1?  Let's see how HTTP/1 works so that we can understand the advantages more clearly.
  • 14. Why gRPC uses HTTP/2 instead of HTTP/1?
  • 15. Why gRPC uses HTTP/2 instead of HTTP/1?  HTTP/1 loads resources one after the other, so if one resource is not loaded, it blocks all other resources behind it. This causes Head-of-Line blocking.  In HTTP/1, headers are not compressed and are sent / received with every request.
  • 16. Let's look at HTTP/2
  • 17. All about HTTP/2  Multiplexing: HTTP/2 can use a single TCP connection to send multiple streams (each stream has an identifier) of data at once so that no resource blocks any other resource.  HTTP/2 can compress the headers along with the messages; It also uses a more advanced compression method called HPACK that eliminates redundant information in HTTP header packets.  Server Push: Generally, a server only serves content ti a client if the client asks for it, but modern webpages involve several dozen separate resources that the client must request. HTTP/2 solves this problem by allowing server to "push" content to a client before the client asks for it.  Let's see a difference between HTTP/2 and HTTP/1. https://imagekit.io/demo/http2-vs-http1
  • 18. 06
  • 19. Types of gRPC API  There are 4 types of gRPC APIs
  • 20. 07