Faye 或 Redis 发布订阅 [英] Faye or Redis Pubsub
问题描述
我以为我了解这项技术,但也许我不了解.两者有什么区别?为什么你会选择一个而不是另一个?
I thought I understood this technology, but maybe I don't. What's the difference between the two? Why would you choose one over the other?
用例:~实时更新.
推荐答案
我是 Faye 的作者.从概念上讲,Faye 和 Redis pub/sub 做的事情非常相似,确实 Faye 的最新版本可以使用 Redis 作为后端.正如 Tom 所说,Redis 适用于您的服务器集群内的进程间消息传递,因为 Redis 客户端将可以访问您的整个 Redis 数据库.
I'm the author of Faye. Conceptually, Faye and Redis pub/sub do very similar things, indeed the latest release of Faye can use Redis as a back-end. As Tom says, Redis is appropriate for inter-process messaging within your server cluster since the Redis client will get access to your whole Redis database.
如果您想通过网络提供可公开访问的发布/订阅服务,例如为您网站的 UI 提供支持,Faye 更合适.它只执行 pub/sub,而不是像 Redis 提供的任何其他存储,并且在 HTTP 和 WebSocket 上工作,而不是在原始 TCP 套接字上工作.它还允许用户定义的客户端和服务器端扩展来扩展它使用的消息传递协议.
Faye is more appropriate if you want to provide a publicly accessible pub/sub service over the web, for example to power the UI for your website. It only does pub/sub, not any other storage like Redis provides, and works over HTTP and WebSocket rather than over a raw TCP socket. It also allows for user-defined client- and server-side extensions to expand the messaging protocol it uses.
这篇关于Faye 或 Redis 发布订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!