gRPC 101

gRPC 101
gRPC 101

gRPC is developed by Google and is a language-neutral, platform-neutral, open-source RPC ( Remote Procedure Call ) framework.  In this article you will get an overview of gRPC.

gRPC overview

gRPC enables client and server applications to communicate transparently and simplifies the construction of connection systems. Say for example in gRPC, client applications can directly all methods of server applications on a different machine just like calling local objects, making it easier for you to create distributed applications and services. 

Similar to many RPC frameworks, gRPC is also based on the following define a service and specify the methods (including parameters and return types) that can be called remotely. 

It uses HTTP/2 as the communication protocol and Protocol Buffers as the serialization protocol.

gRPC call model

1. The client calls method A to initiate an RPC call.

2. Use Protobuf to perform object serialization compression (IDL) on request information .

3. After receiving the request, the server (gRPC Server) decodes the request body, processes the business logic and returns it.

4. Use Protobuf to perform object serialization compression (IDL) on the response result .

5. The client receives the response from the server and decodes the request body. 

gRPC features


HTTP/2 provides mechanisms such as connection multiplexing, two-way streaming, server push, request priority, header compression, etc. It can save bandwidth, reduce the number of TCP connections. The gRPC protocol design uses the existing semantics of HTTP2, the request and response data is sent using HTTP Body, and other control information is represented by Header.

Reference: HTTP/1 vs HTTP/2

What is Protocol Buffers? (ProtoBuf)

The ProtoBuf is a language-neutral, extensible mechanism for serializing structured data (similar to XML, JSON.. etc) developed by google. It has nothing to do with language, and uses Interface Definition Language (IDL) to define the shape of a given message and the attributes in that message. 

The current list of officially-supported languages includes Python, Java, a lite-runtime (Android Java),  Objective-C,  C#,   C++, Dart, Ruby, and Go language generator from the golang/protobuf GitHub repo and JavaScript from the protocol buffers GitHub repo, with more languages in development. 

Multi-Language Support

gRPC supports multiple languages, and can automatically generate client and server function libraries based on the language. Currently it supports 10+ Languages: 

  1. C#
  2. C++
  3. Dart
  4. Go
  5. Java
  6. Kotlin/JVM
  7. Node
  8. Objective-C
  9. PHP
  10. Python
  11. Ruby

Cross-language and cross-platform Support

Officially supported platform includes Linux, Macosx, Windows, Android, IOS, Embedded (IOT).

Easy to use and good scalability

  1. Single line installation
  2. idiomatic API’s, etc ..
  3. Error propagation 
  4. Cancellation propagation
  5. Deadline propagation
  6. Reconnet automatically on broken idle connections. 
Reference: gRPC Core Concepts

Open and Standard compliant

  1. Opensource and growing community & HTTP/2 
  2. Everyone can use the basic features for free. Releases all deliverables in an open source manner under a friendly license agreement.

Production Ready

  1. Reliable, Well tested, and Scalable.
  2. Used in production by several companies like Square, Netflix, CoreOS, Cockroach Labs, Cisco, Juniper networks.

Why should I use gRPC instead of REST?

gRPC uses code generator to provide native code for your given language, you can save a lot of time when writing a custom serializer for JSON or XML. Also it uses ProtoBuf (Payloads are serialized in binary) for sending messages over the network and the messages are much smaller than JSON or XML on the network and this can save you bandwidth and improve overall network performance. 

Reference: Rest vs gRPC


If you are working on a project the same tech stack, say 2 to 5 developers then setting up gRPC will create the overhead and not worth it. On the other hand if you are a large organization and using a large number of different tech stacks and languages that need to interact each other, then gPRC will fit to your requirement. 


  1. Intro to gRPC
  2. gRPC Documentation
  3. Protocol Buffers Documentation
  4. The state of gRPC Web

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top