---
title: "Discussion on \"gRPC - the new REST!\" | Hashnode"
description: "Discussion on \"gRPC - the new REST!\". REST is the ubiquitous way of writing APIs for as long as I can remember. Today I want to introduce you to a new way of writing APIs.\n\nHave you met gRPC?\n\ngRPC is a relatively new way to write APIs and consume them as if you're just calling a functio..."
url: "https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [gRPC - the new REST!](https://under-engineered.hashnode.dev/grpc-the-new-rest?utm_source=hashnode&utm_medium=feed)

REST is the ubiquitous way of writing APIs for as long as I can remember. Today I want to introduce you to a new way of writing APIs. Have you met gRPC? gRPC is a relatively new way to write APIs and consume them as if you're just calling a functio...

Jun 28, 2021 · 7 min read · under-engineered.hashnode.dev  
Read the article

-   [#java](https://hashnode.com/tag/java)
-   [#rest-api](https://hashnode.com/tag/rest-api)
-   [#backend](https://hashnode.com/tag/backend)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Ankeet Maini](https://hashnode.com/@under-engineered)

@under-engineered · Bengaluru, India

  
[View profile](https://hashnode.com/@under-engineered)

Always fixing PR comments :P

## Responses 5

Markdown supported · ⌘↵ to post

[T.J.](https://hashnode.com/@tx0c)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60e798374e18000309d81b28)

you're saying REST is only http/1 ? That's not true, the plain text REST protocol is the most futuristic, and no problem working over HTTP/2 or HTTP/3

gRPC is only good use as protocols within datacenter between micro-services, never meant to be called in browser to server and is probably never going to gain support in browsers

[Ankeet Maini](https://hashnode.com/@under-engineered)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60e798374e18000309d81b28#reply-60e8b0716d962b01bdecb2ed)

so gRPC has benefits from performance level due to protobuf encoding; smaller payloads as well as a clear contract which is tangible and not like REST where things are tied together manually (creation of payload, correct URL, query param vs request body)

[Milo 🏳️‍🌈 🦋 Xeon](https://hashnode.com/@mvoloskov)

[Jul 4, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60e22f0e03707d644a503af2)

Cognitive complexity is a thing. gRPC is nice and all, but how many engineers out there actually fluent in it just like in REST? And remember that this number won't grow unless REST is deprecated which is not going to happen.

Though, gRPC is nice for microservices communication.

[Ankeet Maini](https://hashnode.com/@under-engineered)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60e22f0e03707d644a503af2#reply-60e8afff8aaa3f019846ce95)

I'll reply with a follow up on how to integrate it with web, and try to drive the point home that with generated stubs, maintenance becomes so much easier! Stay tuned :)

[Wei Lun](https://hashnode.com/@weilun)

[Jun 30, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60dbc11f7ad49f6471accac3)

gRPC is just too complex.

[Ankeet Maini](https://hashnode.com/@under-engineered)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60dbc11f7ad49f6471accac3#reply-60e8afa88aaa3f019846ce8f)

isn't it easier, as you have now auto-generated stubs for all the available service methods?

this will make the integration between backend and frontend super tight - same contract is used to generate the code on both ends, no more searching the correct payload or api endpoint :)

[Wei Lun](https://hashnode.com/@weilun)

[Jul 12, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60dbc11f7ad49f6471accac3#reply-60ebede0c551f16b0f85139d)

[Ankeet Maini](https://hashnode.com/@under-engineered) yeah it may sounds easy, but the complexity is on the generation of stubs. For examples:

-   Whether commit stubs to source code or not
-   When to regenerate when protobuf change
-   Dealing with protobuf import paths hell
-   How to version correctly

etc etc...

[Aman Saxena](https://hashnode.com/@AmanTC39)

[Jun 29, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60db379df4984338ee7cba77)

what happens if they add support for http3 in the future BOOM, bye bye REST but still it will take time to adapt in the ecosystem

[Devashish Rana](https://hashnode.com/@devDeveloper)

[Jun 28, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60d9744b703d372ea06c7308)

This is pretty good. I think as a technology, we should focus on the pros and cons, and why was it introduced. I think it was introduced to keep a single library for each client and server, so the changes are centralized, unlike REST.

Pros:

1.  It is fast
2.  It uses http2 under the hood
3.  Single library for each client and server maintained by google

Cons

1.  Protobuf makes the client bulky
2.  No direct use of JSON, it won't make sense for the client to know the schema
3.  No browser support YET
4.  It is new and growing
5.  Proxy Support, as any application deployed is not just simple client and server so, the proxy or gateway layer should understand the protocol as well

I believe this is a pretty good piece of technology for microservices intercommunication as it is fast and can reduce the latency in communication.

[Ankeet Maini](https://hashnode.com/@under-engineered)

[Jun 28, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60d9744b703d372ea06c7308#reply-60d9d94a68364a2e7b2ce930)

Haha, yes I agree there's a bit of ceremony. Generate code and use a grpc-web proxy for the protocol conversions, but overall maintenance wise it will make a lot easier.

[T.J.](https://hashnode.com/@tx0c)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60d9744b703d372ea06c7308#reply-60e79a8f4e18000309d81b60)

-   No browser support ~~YET~~

[Ankeet Maini](https://hashnode.com/@under-engineered)

[Jul 9, 2021](https://hashnode.com/posts/grpc-the-new-rest/60d96711703d372ea06c71e4/comment/60d9744b703d372ea06c7308#reply-60e8af528aaa3f019846ce85)

there is with a proxy to patch over the differences and even http1 to http2[Tomas Y.](https://hashnode.com/@tx0c)

[github.com/improbable-eng/grpc-web/tree/master/go…](https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy)
