Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for RESP3 and Sharded Pub/Sub in Redis 7 #1934

Open
Rakeshya-Kore opened this issue Dec 10, 2024 · 4 comments
Open

Support for RESP3 and Sharded Pub/Sub in Redis 7 #1934

Rakeshya-Kore opened this issue Dec 10, 2024 · 4 comments

Comments

@Rakeshya-Kore
Copy link

Redis 7 introduces significant enhancements to the Pub/Sub mechanism. Unlike Redis 6, where Pub/Sub messages were limited to a single shard, Redis 7 employs a sharded Pub/Sub mechanism. This improvement allows Redis to automatically determine which shard should handle the Pub/Sub traffic for a specific channel.

The sharded Pub/Sub mechanism provides the following benefits:

  1. Load Distribution: It reduces the concentration of connections on a single shard by distributing Pub/Sub traffic across the cluster.
  2. Scalability: This makes the Pub/Sub system more scalable by evenly balancing the workload among available shards.

To leverage the Sharded Pub/Sub feature in Redis 7, the RESP3 protocol is required. However, we have observed that the currently ioredis library does not support RESP3.

We would like to understand:

  1. Are there any plans to add RESP3 protocol support in ioredis to enable Redis 7's advanced features like Sharded Pub/Sub?
  2. If so, could you share any timelines or progress updates?
@Rakeshya-Kore
Copy link
Author

Requesting Someone to update on this ASAP.

@mortensi
Copy link
Member

mortensi commented Feb 5, 2025

Hello @Rakeshya-Kore, sharded Pub/Sub does not require RESP3. I wonder if you have found some obsolete documents or threads. If this is the case, please let me know. Support for both RESP2 and RESP3 is documented:

We are considering supporting Sharded Pub/Sub soon enough; we'll share progress updates later this month.

@Rakeshya-Kore
Copy link
Author

Rakeshya-Kore commented Feb 5, 2025

Hello @mortensi ,

Thanks for the response! I came across this page: https://redis.io/docs/latest/operate/rs/references/compatibility/resp/#deactivate-resp3, where it says, You cannot use sharded pub/sub if you deactivate RESP3 support.

What I understand from this is that the client must support RESP3 for sharded Pub/Sub to work(If RESP3 is deactivated i.e., the server is using RESP2, then sharded Pub/Sub won't work at all because the protocol does not have the necessary features to support it). Please correct me if I'm wrong and provide further clarity.

Secondly, could you please confirm the last point you mentioned? You mentioned that ioredis is considering supporting Sharded Pub/Sub soon. Does this mean that ioredis does not currently support sharded Pub/Sub?

@mortensi
Copy link
Member

mortensi commented Feb 6, 2025

For Redis CE, there is no issue with configuring either RESP2 or RESP3 to use sharded pub/sub.

The note refers to Redis Enterprise Software, which means you must enable RESP3 to use sharded pub/sub on RESP2 or RESP3. We are considering improving the note because it seems misleading. Thanks for sharing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants