#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 Vsevolod Timchenko)

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 Vsevolod Timchenko, 17 months ago

Description: modified (diff)

comment:2 by Vsevolod Timchenko, 17 months ago

Description: modified (diff)

comment:3 by Natalia Bidart, 17 months ago

Resolution: wontfix
Status: newclosed
Type: UncategorizedNew 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!

Note: See TracTickets for help on using tickets.
Back to Top