2

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..

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
MohammadArik
  • 71
  • 1
  • 9
  • 1
    One important thing to mention in your question is what kind of data you will be sending across. For easily serialisable data such as JSON, I would go for gRPC, since it will greatly reduce bandwidth and increase speed, in my experience. The benefit of gRPC for large blobs of binary data won't be as noticeable, and the overhead will be a lot greater, so the decision boils down to the kind of data you'll be sending. – Daniel G Apr 01 '22 at 12:23
  • @DanielG yeah I have structured data... – MohammadArik Apr 04 '22 at 05:09

1 Answers1

1

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.
Daniel G
  • 98
  • 1
  • 10