gRPC vs WebTransport vs WebSocket for inter-service communication

1.4k views Asked by At

So I have built a microservice architecture-based system. My services had to communicate with each other in real time with minimum latency... Which is good for me, gRPC or WebTransport or WebSocket? And why?

My only requirement after speed...

  • I need to know instantaneously if the connection breaks
  • The connection should always be active, not opening on every message transmission

Edit: I will transmit structured data. Format choice is flexible..

1

There are 1 answers

0
Daniel G On BEST ANSWER

From the information you've given, I'd say gRPC ticks all your boxes.

  • gRPC uses channels that will throw an exception if the connection breaks.
  • You only need one channel per client, which can be reused for different services you declare.
  • Data is serialised and deserialised using protobuf, which makes it quite fast and efficient if you have a fixed schema.