How does Yugabyte Redis Pub/Sub work?


Can some one tell me how Yugabyte Redis Pub/Sub works? For example, its dataflow, its relationship between leader and follower, is it publishs always go to leaders and subscribes can be on followers? What happen when a subscriber is not active (connection closed, etc.)? Is the data available to the client when it reconnect? etc.



Hi @mld-cih-

Thanks for your question.

The YEDIS PubSub model closely mirrors Redis’s.

It is memory based, and messages are delivered provided publisher/subscriber are “connected” and retain the connection to the cluster. For example, if a subscriber is not listening when the publish happens, the event will not be seen. So this not a good mechanism if guaranteed/persistent delivery is your requirement.

It is possible to use YEDIS’s other types (such as TimeSeries TS type) or use YCQL to implement a persistent publish/subscribe mechanism, and have the records TTL out after some configurable time (that can be set at a per-record/key level).




Thank you @kannan, it makes clear for me.



Hi @kannan, one more question, please. What happen if I want to use Yugabyte Redis Pub/Sub with a Redis client with cluster support? Is there any special requirement about config?