# How does Yugabyte Redis Pub/Sub work?

**URL:** <https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291>\
**Category:** General\
**Created:** [March 24, 2019, 4:01am UTC](https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291 "2019-03-24T04:01:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mld-cih](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mld-cih](https://forum.yugabyte.com/u/mld-cih)\
**Post date:** [March 24, 2019, 4:01am UTC](https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291/1 "2019-03-24T04:01:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kannan](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/kannan/32/18_2.png) [@kannan](https://forum.yugabyte.com/u/kannan)\
**Post date:** [March 24, 2019, 4:03pm UTC](https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291/2 "2019-03-24T16:03:58Z")

</div>

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](https://docs.yugabyte.com/latest/yedis/api/tsadd/)) 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).

regards,  
Kannan

---

<div class="post-metadata">

**Author:** ![mld-cih](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mld-cih](https://forum.yugabyte.com/u/mld-cih)\
**Post date:** [March 25, 2019, 2:22am UTC](https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291/3 "2019-03-25T02:22:55Z")

</div>

Thank you @kannan, it makes clear for me.

---

<div class="post-metadata">

**Author:** ![mld-cih](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mld-cih](https://forum.yugabyte.com/u/mld-cih)\
**Post date:** [March 26, 2019, 7:02am UTC](https://forum.yugabyte.com/t/how-does-yugabyte-redis-pub-sub-work/291/4 "2019-03-26T07:02:47Z")

</div>

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?
