Why does Redis, a datastore, have Pub/Sub features? My first thought is that it's the wrong layer to implement such a thing. But maybe I need to think outside the box.
Redis is defined as data structure server. Redis provides multiple functionality like memcache, queue, pubsub etc. This is very useful for a cloudapp/webstack where 3 components RabbitMQ(queuing) + XMPP(pubsub) + Memcache can be currently replaced with redis. Queuing is not as feature rich as RabbitMQ though.
That would be true if it was about feeds for end users to subscribe to. Actually it's closer to the concept of events or database triggers - a process that knows the internals of the datastore keeps a connection open and does something when a change happens.
发布评论
评论(2)
Redis被定义为数据结构服务器。 Redis 提供了多种功能,如 memcache、队列、pubsub 等。这对于 cloudapp/webstack 非常有用,其中 3 个组件 RabbitMQ(队列)+ XMPP(pubsub)+ Memcache 目前可以用 Redis 替换。不过,队列功能不如 RabbitMQ 丰富。
Redis is defined as data structure server. Redis provides multiple functionality like memcache, queue, pubsub etc. This is very useful for a cloudapp/webstack where 3 components RabbitMQ(queuing) + XMPP(pubsub) + Memcache can be currently replaced with redis. Queuing is not as feature rich as RabbitMQ though.
如果是供最终用户订阅的提要,情况确实如此。实际上,它更接近事件或数据库触发器的概念 - 一个了解数据存储内部结构的进程保持连接打开并在发生更改时执行某些操作。
That would be true if it was about feeds for end users to subscribe to. Actually it's closer to the concept of events or database triggers - a process that knows the internals of the datastore keeps a connection open and does something when a change happens.