GRPC vs WebTransport vs WebSocket用于服务间通信

发布于 2025-01-18 07:46:45 字数 205 浏览 6 评论 0原文

因此,我已经建立了一个基于微服务架构的系统。我的服务必须与最小延迟相互实时交流……这对我,GRPC或WebTransport或WebSocket有好处?为什么?

我唯一的速度要求...

  • 我需要立即知道连接是否打破
  • 连接应始终处于活动状态,而不是在每个消息传输

编辑上打开:我将传输结构化数据。格式选择是灵活的。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖风昔人 2025-01-25 07:46:45

从您提供的信息中,我可以说GRPC勾选了您所有的盒子。

  • GRPC使用的通道如果连接断开,则会引发异常。
  • 每个客户端只需要一个渠道,可以重复使用您声明的不同服务。
  • 使用Protobuf序列化和应对数据进行了序列化,如果您具有固定的模式,则可以快速有效。

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文