I don't like tools that do many things at once. So GRPC seems to me overhead, it's like kubernetes. GRPC is the tool that combines actually two things: extended Protobuf (Service support) and HTTP2.
I read a lot of articles saying that using GRPC is awesome for performance. And there are two reasons
Here is main part: protobuf and HTTP2 are independent projects, tools, whatever. With that understanding i can say that GRPC is nothing but combining several different tools, like kubernetes combines docker and orchestration tools.
So my questions is: What's actual advantages of using GRPC vs HTTP2 with any payload (CSV, XML, JSON, etc).
Let's skip part about serialization because as i mentioned protobuf is independent library from grpc
gRPC is a framework that uses RPC to communicate. RPC is not Protobuf but instead Protobuf can use RPC and gRPC is actually Protobuf over RPC. You don't need to use Protobuf to create RPC services within your app. This is a good idea if you are doing libraries/apps from small to medium size.
gRPC is a Remote Procedure Call (RPC) framework that uses HTTP/2 as its transport medium. It is especially useful for managing communication between apps in a microservices cluster. For apps to serve gRPC traffic, every network hop between the client and app must use HTTP/2.
grpc-gateway is another technology for creating RESTful JSON APIs from gRPC services. It uses the same . proto annotations to map HTTP concepts to gRPC services. grpc-gateway uses code generation to create a reverse-proxy server.
You just have to make calls to the server address, unlike gRPC, which requires the client setup. REST API still holds importance when the payload is small, and several clients simultaneously make a server call. As a result, gRPC is a lot faster than REST API in most cases.
As you pointed out, gRPC and Protobuf are often conflated. While, in the vast majority of cases, gRPC will be using protobuf as an IDL and HTTP/2 as the transport, this is not always the case.
So then, what value does gRPC provide on its own? For starters, it provides battle-tested implementations of each of those transports, along with first class support for the protobuf IDL. Integrating these things is not trivial. gRPC packages all of them into one nice pluggable box so you don't have to do the legwork.
It also provides you with functionality that HTTP/2 on its own does not. Pluggable authorization/authentication, distributed tracing instrumentation, debugging utilities, look-aside load balancing (including upcoming support for the xDS protocol), and more are provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With