[Django] #30517: Base class for Key Value engines for caching

7 views
Skip to first unread message

Django

unread,
May 27, 2019, 9:44:57 PM5/27/19
to django-...@googlegroups.com
#30517: Base class for Key Value engines for caching
------------------------------------------------+------------------------
Reporter: dulmandakh | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Cache system) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
I think that it would be best to have built-in support for Redis caching
in Django, as it's getting more popular and has other use cases than just
caching. And I found that most of the features overlap with memcached. So
I think that it might be better to refactor BaseMemcachedCache to be base
for KV engines, and use it for both Memcached and Redis, to reduce code
duplication.

I can work on this if approved.

--
Ticket URL: <https://code.djangoproject.com/ticket/30517>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 27, 2019, 9:45:16 PM5/27/19
to django-...@googlegroups.com
#30517: Base class for Key Value engines for caching
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: redis | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by dulmandakh):

* keywords: => redis


--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:1>

Django

unread,
May 27, 2019, 9:45:57 PM5/27/19
to django-...@googlegroups.com
#30517: Base class for Key Value engines for caching
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: redis | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by dulmandakh:

Old description:

> I think that it would be best to have built-in support for Redis caching
> in Django, as it's getting more popular and has other use cases than just
> caching. And I found that most of the features overlap with memcached. So
> I think that it might be better to refactor BaseMemcachedCache to be base
> for KV engines, and use it for both Memcached and Redis, to reduce code
> duplication.
>
> I can work on this if approved.

New description:

I think that it would be best to have built-in support for Redis caching
in Django, as it's getting more popular and has other use cases than just
caching. And I found that most of the features overlap with memcached. So
I think that it might be better to refactor BaseMemcachedCache to be base
for KV engines, and use it for both Memcached and Redis, to reduce code
duplication.

I would like to start discussion about best approach adding Redis support
into Django. Also I can work on this if approved.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:2>

Django

unread,
May 27, 2019, 10:08:03 PM5/27/19
to django-...@googlegroups.com
#30517: refactor BaseMemcachedCache to be a base class for KV engines
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: | Status: new
Cleanup/optimization |

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: redis | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:3>

Django

unread,
May 28, 2019, 2:07:00 AM5/28/19
to django-...@googlegroups.com
#30517: Add Redis cache backend.
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: New feature | Status: closed

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: wontfix
Keywords: redis cache | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* keywords: redis => redis cache
* status: new => closed
* type: Cleanup/optimization => New feature
* resolution: => wontfix


Comment:

Thanks for this proposition. There already exists [https://django-redis-
cache.readthedocs.io/en/latest/index.html django-redis-cache] 3rd party
package with a Redis cache backend for Django. I don't think that we
should move it into core. You can try to start a discussion on the
[https://docs.djangoproject.com/en/2.2/internals/mailing-lists/#django-
developers-mailing-list django-developers mailing list] if you feel that
we can reach a different consensus.

--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:4>

Django

unread,
Jul 10, 2019, 12:49:41 AM7/10/19
to django-...@googlegroups.com
#30517: Add Redis cache backend.
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: New feature | Status: closed

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: wontfix
Keywords: redis cache | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by felixxm):

[https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic
/django-developers/38nas-aMbRw Discussion on django-developers].

--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:5>

Django

unread,
Jul 10, 2019, 2:11:01 AM7/10/19
to django-...@googlegroups.com
#30517: Add Redis cache backend.
-------------------------------------+-------------------------------------
Reporter: dulmandakh | Owner: nobody
Type: New feature | Status: closed

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: wontfix
Keywords: redis cache | Triage Stage:

| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

It's worth quoting Aymeric's post on the mailing list:

> To move this forwards, my suggestion would be to write a DEP, to flesh
out the rationale for a built-in solution, and to focus on the breadth of
functionality the built-in backend would support. My preference would be a
basic set of features, like the other cache backends. I believe that's
what django-redis-cache does. This will leave room for third-party
packages like django-redis to provide more advanced features. To give a
concrete example, like other cache and database backends, a redis backend
could provide persistent connections but not implement a connection pool.
Until now Django has left the management of connection pools to third-
party packages.

--
Ticket URL: <https://code.djangoproject.com/ticket/30517#comment:6>

Reply all
Reply to author
Forward
0 new messages