StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.89k stars 1.51k forks source link

Question: Do I lose any feature from StackExchange.Redis by disabling PUBSUB command? #2466

Closed ricardomomm closed 1 year ago

ricardomomm commented 1 year ago

Azure subscription tiers are based in connection numbers, and I want to disable SUBSCRIBE from my application because I don't use and then save a bit, my question is: do I lose any feature from the library by disabling it? I see it in the documentation as "Optional" but it doesn't specify if I lose something or not. Is there any internal feature depending on it?

Example: do I lose server maintenance event if I disable SUBSCRIBE command?

Thanks.

philon-msft commented 1 year ago

Yes, the server maintenance events will no longer be raised, and the library's internal mechanism using the events to refresh its view of server topology will no longer work. The library relies on a PUB/SUB channel to receive notifications from an Azure Redis cache when maintenance or other operations result in topology changes in the cache. It reacts to those notifications by refreshing its view of server topology to avoid sending commands to the wrong endpoints within the cache. For details see #1876. Disabling SUBSCRIBE will disable this system, leading to more failed commands following server maintenance. Note that the topology view is only used for clustered caches, so if you're using a non-clustered cache, disabling the system will have minimal impact.

ricardomomm commented 1 year ago

Thanks @philon-msft , I wonder if this can be added to documentation, it seems very important to compliment the "Optional" part and to help developers taking this decision.