gRPC - (Google's) Remote Procedure Calls
In 2001 google came up with a single general purpose infrastructure called Stubby to connect it's large number of micro-services running across its data centers around the world. They called it gRPC.
Concept of Remote Procedure Calls is not new. It was theoretically introduced back in 70's, and first practical implementation came in early 80's.
What is RPC or remote procedure call. As the name implies its actually call to a procedure (subroutine) which is not on the same address space. Now it can be another computer, sitting next to the calling computer or it can be a computer somewhere else on the shared network. Idea is to have a protocol by using which a program can call a procedure (function / subroutine) without the developers needing to know where it is located. Just like any other local procedure or subroutine call.
In 2001 google came up with a single general purpose infrastructure called Stubby to connect it's large number of micro-services running across its data centers around the world. They called it gRPC.
In 2015 they decided to build a new improved version of stubby and make it open source. gRPC (v1.0) was released in 2016. Nowadays gRPC is being used in many organizations aside from Google to power use cases from micro-services to mobile, web, and IoT devices.
gRPC is a high performance, open source framework that helps developers to build distributed services and applications.
Let's look at some key features of gRPC:
- High Performance: gRPC is well known for its speed and efficiency. Which makes it ideal for the applications that need to handle to lots of data and respond to requests as quickly as possible.
- Cross-Platform: It works on variety of platforms including windows, macOS, Linux and mobile devices, making it a versatile tool for the software engineers to build applications that run on multiple different systems.
- Security: gRPC supports Transport Layer (TLS) communication and token based authentication, which helps to make your data transfers safer.
- Open-Source: Being open source project gRPC is free to use and modify it to fit to your own needs. Developer's can also contribute in making it better by suggesting changes, that can then be used by everyone else.
- Programming Language Support: gRPC is supported with many programming languages including Java, C#, Python, Go and C++. This makes it easy to use for the developers having skillsets from different languages.
gRPC for Frontend Web Applications:
Initially it was not possible to use gRPC from browser-based applications, because gRPC requires HTTP/2, and browsers don’t expose any APIs that let Javascript or Web Assembly code to control HTTP/2 requests directly.
But things are changing rapidly and there are now several ways you can use gRPC in your browser based applications. gRPC-Web is an extension of gRPC which makes it compatible with browser-based code (technically, it’s a way of doing gRPC over HTTP/1.1 requests).
Finally here are some useful resources to keep learning more about gRPC.