Golang tour分布式模式

huangapple go评论92阅读模式
英文:

Golang tour distributed pattern

问题

根据这篇文章,应用引擎前端和游乐场后端通过RPC调用进行通信。每个应用引擎前端实例和游乐场实例都可以创建以支持扩展。

Golang tour分布式模式

我在思考在保持RPC的同时,如何在前端请求和后端实例之间实现负载均衡的模式(解决方案)。

一种解决方案可能是使用一个全局工作队列,将任务放入其中,并使用一个'Reply-To'头指向每个前端实例队列,将响应放入其中。类似于以下示意图(来自RabbitMQ教程),其中rpc_queue在后端实例之间共享:
Golang tour分布式模式

我不确定这是否是一个好的方法,特别是如果共享队列离线,整个系统将失败(但如何处理这种情况?)。

谢谢。

英文:

According to this article, the app-engine front-end and the playground back-end communicate through RPC calls. Each one of app-engine front-end instance and playground instance can be created to support scaling.

Golang tour分布式模式

I am asking myself what is/are the patterns (solutions) to load balance works between front-end request and back-end instance while keeping RPC.

One solution may be to use one global working queue where tasks are puts inside it with a 'Reply-To' header. This header should point to a per front-end instance queue where responses are put. Something like the following schema (from RabbitMQ tutorial) with rpc_queue shared between back-end instances :
Golang tour分布式模式

I am not sure this would be a good way to do especially the fact that if the shared queue is offline, the whole system fail (but how to take care of this?).

Thank you.

答案1

得分: 1

作为对我在第一篇文章中收到的评论的回答和跟进,我开发了一个名为Indenter的小型概念验证,基于提出的服务发现守护进程的想法(为了简单起见,我使用etcd而不是ZooKeeper)。

我写了一篇关于它的文章,并发布了代码,如果有人有兴趣的话:

Indenter:一个可扩展、容错、分布式的Web服务,复制了Go Playground的架构。

英文:

As an answer and a follow-up of comments I received on the first post, I developed Indenter, a small proof of concept based on the idea proposed of a service discovery daemon (I use etcd instead of ZooKeepr for simplicity however).

I wrote an article about it and release the code if someone may be interested one day:

Indenter: a scalable, fault-tolerant, distributed web service copying the go playground architecture.

huangapple
  • 本文由 发表于 2014年5月15日 04:03:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/23664069.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定