gRPC

gRPC

Application and Data / Languages & Frameworks / Remote Procedure Call (RPC)
Frontend Developer ·
Needs advice
on
GraphQLGraphQL
and
gRPCgRPC

I used GraphQL extensively at a previous employer a few years ago and really appreciated the data-driven schema etc alongside the many other benefits it provided. At that time, it seemed like it was set to replace RESTful APIs and many companies were adopting it.

However, as of late, it seems like interest has been waning for GraphQL as opposed to increasing as I had assumed it would. Am I missing something here? What is the current perspective regarding this technology?

Currently, I'm working with gRPC and was curious as to the state of everything now.

READ MORE
9 upvotes·162.8K views
Replies (1)
developer at freelance·

They both have their usage case but it seems gRPC is where the market is gravitating towards

READ MORE
1 upvote·3.5K views
Needs advice
on
gRPCgRPC
and
SignalRSignalR

We need to interact from several different Web applications (remote) to a client-side application (.exe in .NET Framework, Windows.Console under our controlled environment). From the web applications, we need to send and receive data and invoke methods to client-side .exe on javascript events like users onclick. SignalR is one of the .Net alternatives to do that, but it adds overhead for what we need. Is it better to add SignalR at both client-side application and remote web application, or use gRPC as it sounds lightest and is multilingual?

SignalR or gRPC are always sending and receiving data on the client-side (from browser to .exe and back to browser). And web application is used for graphical visualization of data to the user. There is no need for local .exe to send or interact with remote web API. Which architecture or framework do you suggest to use in this case?

READ MORE
5 upvotes·538.1K views
Replies (1)
Recommends
on
SignalR
at

SignallR is not a strict contract based protocol like Grpc, its a framework for bidirectional client-server communication and by far the most versatile one. where as Grpc is on the other performance optimized point to point communication RPC, clients need to be agree on a schema/contract and is cross platform performance. it comes with pain of handling incompatible types and having to do a lot of modeling work and versioning; If you are not into c++ stack or so and mostly leaning to .net and js as your primary stack: I would say stick with Signalr for now.

If interoperability is something that you are looking into stick with signalR / socketIo etc ,al so they can do pub sub and all magic tricks (absent in GRpc it is not designed for it) if performance and cool thing to try GRpc

Note: MesasgePack over SignalR is faster than or equal to GRpc,

Dragons Ahead : SignalR and GRpc work on two different Http versions so hosting them under a single process is not going to work: Do take a look into Deepstream IO.

READ MORE
3 upvotes·2.4K views
Needs advice
on
gRPCgRPC

What to use when and what is the main difference between gRPC or WebSockets. Is Websockets using HTTP 1.0, then how it is bidirectional?

READ MORE
4 upvotes·94.4K views
Replies (3)
Senior Software Engineer at Mews·
Recommends
on
gRPC
Socket.IO

WebSocket is a low-level transport protocol which provides bidirectional communication channel between client and server. HTTP is only used for establishing the connection.

gRPC is a higher-level RPC framework which builds on top of HTTP/2. Bidirectional communication channel is provided by HTTP/2.

So the comparison here should be either between WebSocket and HTTP/2, or gRPC and some WebSocket framework, for example Socket.IO. WebSocket can be seen as obsolete technology compared to HTTP/2 for majority of use cases (exception being handling of binary data on JavaScript client). With emergence of HTTP/3 (aka QUIC) there's also a new web technology WebTransport.

READ MORE
4 upvotes·304 views

Hi i'using gRPC. Its bi-directional in 2 ways: Bi direction can be archived in following way: 1) Create gRPC server1 2) Create gRPC server 2 Each with its own interface 3) Connect Server 1 as Client of server 2 4) Connect Server2 as Client of server 1 5) Now you are fully bi-directional

Simplier Bi-directionalita may be archived by: 1) Create gRPC Server 2) Connect to server with a client 3) Once you invoke some method an answer will be returned (in sync / async ways) [Remote procedure call]

READ MORE
2 upvotes·2 comments·235 views
Miguel Acevedo
Miguel Acevedo
·
September 10th 2021 at 4:13AM

For websocket to make it bidirectional it use a call and long waiting (long timeout for the call) so can wait for message, it’s a workaround, if you can I would use grpc (I use it for server to server communication), for more details for websocket you can check this article: https://sookocheff.com/post/networking/how-do-websockets-work/

·
Reply
Garth Michel
Garth Michel
·
February 8th 2022 at 6:16PM

gRPC has a bunch of advantages over websockets. You can use it single connection/request/close connection, you can do streaming, or you can do bi-directional streaming.

Another advantage is that you have a singular definition language for your messages, which is strong typed. You're also able to generate libs for running your server in many different languages (13 I think), as well as for connecting to the server. You can have your server running written in Go, or Rust, while you might be connecting with PHP, or Python.

·
Reply
View all (3)