Opened 17 months ago
Closed 17 months ago
#34764 closed New feature (wontfix)
Add support for Clusterized Redis deployments
Reported by: | Vsevolod Timchenko | Owned by: | nobody |
---|---|---|---|
Component: | Core (Cache system) | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The RedisCacheClient is explicitly initialized with the standard Redis client from the redis-py
library:
import redis self._lib = redis ... self._client = self._lib.Redis
To work with clusterized deployments another class, RedisCluster
, has to be used. It offers support for cluster features and peculiarities, i.e. smart retries and refreshes on MOVED
errors as well as node discovery.
Relevant piece of code:
https://github.com/django/django/blob/main/django/core/cache/backends/redis.py#L39
Redis class that I propose to support:
https://github.com/redis/redis-py/blob/master/redis/cluster.py#L431
Change History (3)
comment:1 by , 17 months ago
Description: | modified (diff) |
---|
comment:2 by , 17 months ago
Description: | modified (diff) |
---|
comment:3 by , 17 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Type: | Uncategorized → New feature |
Hello Vsevolod Timchenko, thank you for your interest in making Django better!
I believe that you can achieve this by defining your own client and configuring the
CACHES
settings accordingly. I see some useful comments here. I personally think that Django itself shouldn't support every redis configuration, considering that there are mechanisms to override the default setup.If you disagree, the recommended path forward is to first propose and discuss the idea/request with the community and gain consensus. To do that, please start a new conversation on the Django Forum, where you'll reach a wider audience and likely get richer feedback.
I'll close the ticket following the triage guide, but if there is a community agreement for the proposal, you are welcomed to come back to the ticket and point to the forum topic, so we can then re-open it. For more details, please see the documented guidelines for requesting features.
Thanks!