可扩展的实时 Pub/Sub 引擎
我正在寻找一个发布/订阅引擎,具有以下要求:
- 非常低的延迟 << 0.5 秒
- 可扩展
- 分片(基于地理本地化)
我希望能够拥有多个发布/订阅服务器,并且能够从任何服务器发布或订阅频道,无论在哪个服务器上声明频道。
例如:
如果用户 A 连接到服务器 SRV1,用户 B 连接到服务器 SRV2,如果 >用户 B 订阅“MyChannel”,用户 A 在频道“MyChannel”上发布内容,用户 B< /strong> 即使他没有连接也会收到消息同一个服务器。
不知道Redis能不能做到这一点。我没有找到任何有关该主题的信息。
I'm looking for a pub/sub engine, with the following requirements:
- Very low latency < 0.5 sec
- Scalable
- Shardable (based on geo localisation)
I'd like to be able to have multiple pub/sub servers and be able to publish or subscribe to channels from any server, no matter on which server the channel is declared.
For example:
If user A is connected to server SRV1 and user B connected to server SRV2, If user B subscribe to "MyChannel" and user A publish something on channel "MyChannel", user B will get the message even if he's not connected to the same server.
I don't know if Redis is able to do that. I didn't find anything about the subject.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我们已经使用 ZeroMQ 及其发布/订阅功能一段时间了,我们对我们的功能非常满意正在看到。
下一个 版本 中的内容也值得一看(减少网络通过向上游推送订阅请求来获得带宽)
We've been using ZeroMQ and it's pub/sub features for while now and we're very happy with what we're seeing.
It's also worth looking at what's coming up in the next version (reducing network bandwidth by pushing subscription requests upstream)
我建议您查看实时系统数据分发服务 (DDS) 标准。它专门设计为适用于实时和非实时系统的可扩展发布/订阅中间件。
它有一些成熟的实现,所有这些都有自己的优点,但通常这些实现都是可扩展的和低延迟的。
这些是我建议您查看的实现(如果您需要它们在 WAN 环境中工作,我想前两个对此有很好的支持):
I suggest you look at Data Distribution Service for Real Time Systems (DDS) standard. It's specifically designed to be a scalable pub/sub middleware both for real-time and non-real-time systems.
It has a few mature implementations all of which has it's own strength points, but generally the implementations are scalable and low latency.
These are the implementations I would suggest you look at (If you need them to work on a WAN environment, I guess the first two ones have great support for that):
您似乎正在寻找某种消息传递。尝试 RabbitMQ,使用 shovel 或 federation 插件
It seems you are looking for some sort of messaging. Try RabbitMQ, with shovel or federation plugins
nanomsg
是ZeroMQ
,由同一作者编写,具有多种语言绑定。它是用 C 编写的,并使用零复制机制。如果您正在寻找出色的延迟,并且愿意亲自动手(如果您的目标是极端的东西,那么您应该这么做),我会推荐这两者之一。
如果您正在寻找卓越的吞吐量,请选择 Kafka。
请注意,这些解决方案都没有实现开箱即用的地理定位,Redis 3.2 将具有以下功能: http://antirez.com/ news/89
如果您正在寻找一个简单的、“足够好”的解决方案,我会选择
Redis
(请务必阅读 这篇来自 aphyr 的博客文章首先)。nanomsg
is a successor toZeroMQ
, written by the same author, and with many language-bindings.It is written in C and uses zero-copy mechanisms. If you're looking for exceptional latency, and are willing to get your hands dirty ( which you should if you aim for something extreme ), I would recommend one of those two.
If you're looking for exceptional throughput, go with
Kafka
.Note, none of those solutions implement geolocation out of the box, Redis 3.2 will have something : http://antirez.com/news/89
If you are looking for an easy, "good enough" solution, I'd go with
Redis
( be sure to read this blog post from aphyr first ).