gRPC is a highly-efficient communication framework that can be even 10 times faster than REST. However, it's still not as widely known as its alternatives. Is there any specific reason behind that?
What is gRPC?
gRPC is a framework that implements RPC (Remote Procedure Call). It was initially created by Google, but now it's open source. It's high performance mainly comes from using HTTP/2 to communicate and Protocol Buffers to serialize messages. Otherwise, it provides multiple other features, such as authentication, client-side load balancing or bidirectional streaming.
Key, stand-out features
Stream-based, reactive RPC
RPC is an idea of allowing you, a developer, to make network calls as if they were local functions. Its goal is to make such external calls more fluent and natural around other invocations, without too much of bloated, protocol-specific preparation. The API to make the calls is often prepared upfront, so you just need to import it to use it.
Other RPC implementations try to accomplish that by entirely hiding the fact that the call is actually going over the wire. Unfortunately, such a simple approach doesn't make our lives easier. There is significant difference between local and remote calls, especially in reliability. Local calls share local hardware that can be efficiently used to coordinate the calls. Remote calls go through the network that is inherently unreliable. Packets can get altered, arrive out of order, be broken, be delayed, get lost (these are just a few examples on top of my head, the list could be longer...). Due to those reasons, completely hiding from developers the fact that RPC calls are remote calls can lead to major performance degradation, to put it mildly, because developers might simply not notice that given call is a remote call, not a local one.
gRPC approach is different. It hides remote calls under stream-based reactive interfaces. This relatively simple, yet effective change makes you think about those calls differently and makes it more prominent that they actually go to external services. Additionally, it suits the streaming functionality provided by the framework, where both sides can exchange data in streams, that are either unidirectional or bidirectional.
Efficient and concise HTTP/2 communication
Communication itself is based on HTTP/2. It's an upgrade to the previous version, HTTP/1.1, with better performance as the main improvement, which is achieved by:
- encoding messages in bytes rather than text;
- multiplexing, allowing requests to be processed entirely parallelly over the same connection;
- compression of redundant headers on subsequent messages.
Even though alternatives to gRPC, such as REST, can also use HTTP/2, it's not always the case since a lot of mature technology still relies on older, HTTP/1.1. According to certain sources, HTTP/1.1 is still used by about 20% of the World Wide Web - so make sure that you don't belong to them. HTTP/2 is supported by browsers and other software by some time already, so it's rather safe to start using it today. In gRPC, HTTP/2 is the minimal required version.
Small messages and fast serialization via Protocol Buffers
gRPC uses Protocol Buffers (aka protobuf) for schema definition and message serialization. In here, messages are much smaller and can be processed much faster, comparing to JSON or XML.
Schemas are prepared in advance in universal proto schema language. The schemas are then used to generate appropriate objects in target programming languages (e.g., classes in Java) on build time. Next, on runtime, messages are serialized to a compact sequence of bytes, that can be processed much faster. The speed is improved due to a couple of reasons:
- Smaller messages result in less data to process.
- Schema details are processed in advance, so that you can focus on message content during serialization (e.g., during serialization, fields are identified by compact indexes, not full names).
- Supports a number of data types, so that the processing can be better optimized for each (e.g., int32 and int64).
- Messages can contain extra metadata to optimize the processing (e.g., value length known upfront can improve buffers allocation and concurrency).
According to certain resources, Protobuf can be 6 times faster than JSON.
Other interesting features
Besides the features mentioned above, there is:
- Authentication: supports auth mechanisms such as SSL/TLS, ALTS or token-based authentication (e.g., OAuth2).
- Interceptors: middleware software that can address cross-cutting concerns (e.g., caching, logging).
- Error handling mechanism: custom status codes that are more accurate and relevant to RPC nature.
- Cancellation: either clients or servers can cancel RPC at any time.
- Deadlines (aka timeouts): clients can specify for how long are they are willing to wait for RPC to complete before it's terminated.
- Retries: in case of failures, clients can configure retries with specialized strategies such as exponential backoff that are extendable.
- Load balancing: client-side load balancing, with various strategies available and ability to extend them.
- Health checks: servers can share health checks that can be used by clients to check the health of the server.
- Flow control: a mechanism that is used to ensure that a receiver of messages won't get overwhelmed by a fast sender.
- Compression: reduces the amount of data that is sent over the wire.
Check out the official guides to learn more.
Examples
If you are interested to see how gRPC looks in code, you can take a look at examples shown in Spring docs.
if it's that good, why is it not that popular?
Once you read the features above and add all things up, you might be thinking: Okay, it sounds really compelling, nonetheless there is not too much noise about it over the net. Why is that? Unfortunately, even though gRPC is quite good, there are certain drawbacks.
Support for only a couple of programming languages
To use gRPC, you have to use external libraries that provide client and server SDKs. Unfortunately, it's maintained only for a couple of the most popular languages. As of 2026, the supported languages are: C# / .NET, C++, Dart, Go, Java, Kotlin, Node, Objective-C, PHP, Python, Ruby and Swift.
Requires dedicated tooling
gRPC does not work out of the box within a given language. I already mentioned that it requires its libraries, but in some cases it can also require additional components (e.g., specific proxy setup, as explained in gRPC Web tutorial).
Alternatives, such as REST, can often be implemented using only core language features (e.g., HTTP and JSON) since it works on mechanisms that's been there for a longer time and the mechanisms are more mature.
Not available in older HTTP versions
gRPC requires HTTP/2. Depending on how you look at this, it can be either advantage or disadvantage. In certain cases (rather minority, but still), it can be a blocker, stopping from adoption of gRPC. Unfortunately, there are still components (e.g., proxies) that downgrade the communication to HTTP/1.1.
Slightly more complicated
gRPC achieves high performance at a cost of simplicity - messages are compact and sent in bytes, sacrificing readability. It can make work harder when we need to review message content, and a developer might be forced to use specialized tooling for debugging purposes, which may also be limited. This all can be too overwhelming and not worth it, especially if high performance is not a major concern.
Where it can be successfully used
As you can see, gRPC comes with some promising technical solutions, but also with certain drawbacks that can make it hard to use it. Nonetheless, it can still be used successfully, most often for internal communication between services. Having full control of communication on both sides fits nicely with gRPC and its features. Used technology is rather limited, so there are no issues with a lack of support for specific devices. Complex communication can be thoroughly logged by services if there is such need. On the other hand, support for various communication styles (uni- or bidirectional, unary or streaming), performance and a couple of built-in, commonly used in network communication mechanisms (load balancing, retries, timeouts) make gRPC more than sufficient choice for such scenarios.
I hope that this succinct overview let you understand gRPC slightly better.
Top comments (0)