duanlieshuang5330 2017-01-23 15:55
浏览 7

如何连接分布式Go应用程序?

I have two go apps running on different machines. I want them to communicate with each other in a native fast manner.

How do I do it better? I worked with Erlang and find very handy the way it's implemented there.

What are preferred ways to communicate between Go apps?

  • 写回答

1条回答 默认 最新

  • doulangbizhan5160 2017-01-30 14:51
    关注

    net/rpc - out of the box & fast

    gRPC - fast and universal (imo the way to go)

    net/rpc/jsonrpc - good when you need human readable messages or want to integrate go with client side js code

    plain HTTP - overkill for communication between go programs, you'll have to plan routes and data encoding yourself, which is unnecessary effort

    message queue - a bit slower approach, but you can benefit from advanced routing and persistence which they provide

    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作