Up and Running with gRPC

Hello, Today I am going to talk about gRPC.

A high performance, open source universal RPC framework by google.

Now its part of the Cloud Foundation (CNCF)

Let’s Understand RPC!

An RPC is a Remote Procedure Call. Google introduce gRPC, But…


This content originally appeared on DEV Community and was authored by Sadhan Sarker

Hello, Today I am going to talk about gRPC.

A high performance, open source universal RPC framework by google.

Now its part of the Cloud Foundation (CNCF)

Let's Understand RPC!

An RPC is a Remote Procedure Call. Google introduce gRPC, But Common Object Request Broker Architecture (CORBA) had RPC before!

Image description

In this above example, you see right side a server code written any other language and left client code calling server function. Okay, Lets consider server written in python we want to call this function from another language, what we will do we simply create a rest api then call that api using other language client. Now think 🤔 is not it cool? if we could call that function nativity like we call functions. I know that will be amazing using RPC we can do that easily.

Here is an another example from grpc.io website. You can see gRPC server code is written in C++, and gRPC Stubs Or Clients are written in different languages. Here as Stubs they are using Ruby and Java Android client. Do not worry I will share complete example end of the season.

Image description

When we choose gRPC?

  • When we wants to build microservices
  • Wants to communicate between cross-languages services
  • Planning to build distributed services
  • Needs client & server streaming 
  • Needs Http/2 based transport protocol

Read more

gRPC vs REST

REST
REST uses HTTP/1.1 protocol through the JSON or XML messaging format. Common http verbs like {GET, POST, PUT, DELETE etc}

gRPC
gRPC uses HTTP/2 protocol through Protocol buffer. Methods {unary, server-streaming, client-streaming and bi-directional call}. It offers language independence support 11 programming languages.

gRPC methods/operations

Image description

What is Protocol Buffer

  • Protocol buffer are language language-neutral, platform-neutral extensible mechanism for serializing structured data
  • Code generated for any language
  • Very convenient for transporting a lot of data
  • Data is binary and efficiently serialized (small payloads)
  • Support Java, Go, Python, NodeJs, Objective-C, C++ and more with proto3 language version.

Read more

gRPC vs Rest

Image description

Sample gRPC Based Micro-service Architecture

Image description

Complete gRPC server & clients check that Demo Codebase

Congratulations

I hope we learn something exciting about gRPC framework. Thanks for time & passion. Feel free to ask me anything.

Say Hi to me on Twitter, Linkedin, and Medium where I keep on sharing interesting updates.


This content originally appeared on DEV Community and was authored by Sadhan Sarker


Print Share Comment Cite Upload Translate Updates
APA

Sadhan Sarker | Sciencx (2022-01-04T05:00:18+00:00) Up and Running with gRPC. Retrieved from https://www.scien.cx/2022/01/04/up-and-running-with-grpc/

MLA
" » Up and Running with gRPC." Sadhan Sarker | Sciencx - Tuesday January 4, 2022, https://www.scien.cx/2022/01/04/up-and-running-with-grpc/
HARVARD
Sadhan Sarker | Sciencx Tuesday January 4, 2022 » Up and Running with gRPC., viewed ,<https://www.scien.cx/2022/01/04/up-and-running-with-grpc/>
VANCOUVER
Sadhan Sarker | Sciencx - » Up and Running with gRPC. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/04/up-and-running-with-grpc/
CHICAGO
" » Up and Running with gRPC." Sadhan Sarker | Sciencx - Accessed . https://www.scien.cx/2022/01/04/up-and-running-with-grpc/
IEEE
" » Up and Running with gRPC." Sadhan Sarker | Sciencx [Online]. Available: https://www.scien.cx/2022/01/04/up-and-running-with-grpc/. [Accessed: ]
rf:citation
» Up and Running with gRPC | Sadhan Sarker | Sciencx | https://www.scien.cx/2022/01/04/up-and-running-with-grpc/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.