Faye or Redis Pubsub

后端 未结 2 1629
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 02:08

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?

Usecase: ~Realtime updates.

相关标签:
2条回答
  • 2021-02-02 03:00

    Redis publish/subscribe is a very simple system for internal use in a server cluster - it requires an open connection to redis (unauthenticated and giving complete access to everything in redis).

    Obviously this is the most efficient way to handle scenarios where this is appropriate, but if you need authentication, reliable delivery, or http connections you will need to add a more complete messaging system on top of redis. Faye is one of the options in this space.

    0 讨论(0)
  • 2021-02-02 03:05

    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.

    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.

    0 讨论(0)
提交回复
热议问题