Faye 与 Socket.IO(和 Juggernaut)
Socket.IO 似乎是最流行、最活跃的 WebSocket 模拟库。 Juggernaut 使用它来创建一个完整的发布/订阅系统。
Faye 也很受欢迎且活跃,并且拥有自己的 javascript 库,使其完整的功能可与 Juggernaut 相媲美。 Juggernaut 使用节点作为其服务器,而 Faye 可以使用节点或机架。 Juggernaut 使用 Redis 进行持久化(更正:它使用 Redis 进行发布/订阅),而 Faye 仅将状态保存在内存中。
- 以上一切准确吗?
- Faye 说它实现了 Bayeux - 我认为 Juggernaut 不会这样做 - 是因为 Juggernaut 的级别较低(IE,我可以使用 Juggernaut 实现 Bayeux),
- 如果 Faye 愿意的话,可以切换到使用 Socket.IO 浏览器 javascript 库吗?或者他们的 javascript 库做了根本不同的事情吗?
- 这些项目之间是否存在其他建筑/设计/理念差异?
Socket.IO seems to be the most popular and active WebSocket emulation library. Juggernaut uses it to create a complete pub/sub system.
Faye is also popular and active, and has its own javascript library, making its complete functionality comparable to Juggernaut. Juggernaut uses node for its server, and Faye can use either node or rack. Juggernaut uses Redis for persistence (correction: it uses Redis for pub/sub), and Faye only keeps state in memory.
- Is everything above accurate?
- Faye says it implements Bayeux -- i think Juggernaut does not do this -- is that because Juggernaut is lower level (IE, I can implement Bayeux using Juggernaut)
- Could Faye switch to using the Socket.IO browser javascript library if it wanted to? Or do their javascript libraries do fundamentally different things?
- Are there any other architectural/design/philosophy differences between the projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
披露:我是《Faye》的作者。
Faye 上的服务器端上运行与 Juggernaut 相比,它看起来要复杂得多,因为 Juggernaut 委托更多,例如,它将传输协商委托给 Socket.IO,将消息路由委托给 Redis。这些都是很好的决定,但我决定使用贝叶意味着我必须自己做更多的工作。
至于设计理念,Faye 的首要目标是它应该适用于任何可以使用 Web 的地方,并且应该非常容易上手。上手真的很简单,但它的可扩展性意味着它可以以非常强大的方式进行定制,例如,您可以通过添加身份验证扩展将其变成服务器到客户端的推送服务(即停止任意客户端推送) 。
还正在进行使其在服务器端更加灵活的工作。我正在考虑添加集群支持,并使核心 pub-sub 引擎可插拔,以便您可以使用 Faye 作为另一个 pub-sub 系统(如 Redis 或 AMQP)的无状态 Web 前端。
我希望这对您有所帮助。
Disclosure: I am the author of Faye.
Faye probably looks a lot more complex compared to Juggernaut because Juggernaut delegates more, e.g. it delegates transport negotiation to Socket.IO and message routing to Redis. These are both fine decisions, but my decision to use Bayeux means I have to do more work myself.
As for design philosophy, Faye's overriding goal is that it should work everywhere the Web is available and should be absolutely trivial to get going with. I'ts really simple to get started with but its extensibility means it can be customized in quite powerful ways, for example you can turn it into a server-to-client push service (i.e. stop arbitrary clients pushing to it) by adding authentication extensions.
There is also work underway to make it more flexible on the server side. I'm looking at adding clustering support, and making the core pub-sub engine pluggable so you could use Faye as a stateless web frontend for another pub-sub system like Redis or AMQP.
I hope this has been helpful.
我对费伊的作者所说的话非常感兴趣。正如我所说,我还没有使用过它,很高兴知道它与 Juggernaut 相比如何。这可能是使用最好的工具来完成工作的情况。如果您需要 pubsub,Juggernaut 就能很好地满足您的需求。
I'll be really interested in what Faye's author has to say. As I say, I haven't used it and it would be great to know how it compares to Juggernaut. It's probably the case of using the best tool for the job. If it's pubsub you need, Juggernaut does that very well.
菲当然可以。
Socket.IO 之上的类似项目的另一个示例:
https://github.com/aaronblohowiak/Push-它
Faye certainly could.
Another example of a similar project on top of Socket.IO:
https://github.com/aaronblohowiak/Push-It