What the difference between JSON RPC with HTTP2 vs grpc?
Asked Answered
C

1

23

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

  • protobuf is used, it's smaller than json or xml.
  • GRPC uses HTTP2 for transport protocol

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

Coacher answered 8/11, 2019 at 13:25 Comment(0)
H
24

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.

Howarth answered 13/11, 2019 at 20:27 Comment(2)
Really great answer. You seem to know a lot about gRPC. Would have loved to hear some nice things about JSON-RPC's use cases and pros.Emerald
The problem is ultimately that not every language implementation of grpc has all those features. Like the node grpc library doesn't support promises and server side interceptors... etc. So while GRPC the protocol might have support, implementations may lack them.Madagascar

© 2022 - 2024 — McMap. All rights reserved.