apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.55k stars 466 forks source link

Support namespace in Pub/Sub commands #2097

Open PragmaTwice opened 9 months ago

PragmaTwice commented 9 months ago

Search before asking

Motivation

Currently the namespace mechanism is not supported by Pub/Sub series commands.

Actually it may be not hard to support by using concurrent containers in TBB.

Solution

No response

Are you willing to submit a PR?

JxLi0921 commented 9 months ago

According to the redis docs( https://redis.io/docs/interact/pubsub/ ), the Pub/Sub command in redis is not related to the database numbers.

Pub/Sub has no relation to the key space. It was made to not interfere with it on any level, including database numbers. Publishing on db 10, will be heard by a subscriber on db 1.

It seems that the namespace mechanism in kvrocks has similar purpose as the database numbers in redis, so if we want the commands to be consistent with redis, will it be better if we just keep using current implementation?

Chiro11 commented 7 months ago

Do you still think this feat should be implemented? I think what @JxLi0921 said makes sense. But if you think this is valuable, please assign it to me. I am willing to have a try as my first issue.