Redis cache support in core

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Redis cache support in core

DULMANDAKH Sukhbaatar-2
Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3a506133-f08a-4d25-a9c5-099aae3722d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Josh Smeaton
There are already several 3rd party packages that implement redis as a django cache backend, for example https://github.com/niwinz/django-redis

We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.


On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Ivan Anishchuk
How about making one of the third-party packages an optional dependency? Celery, for example, does that: you can just install celery[redis] without having to figure out what other packages you need to enable redis support.

Ivan.

On Wed, Jun 19, 2019 at 6:44 AM Josh Smeaton <[hidden email]> wrote:
There are already several 3rd party packages that implement redis as a django cache backend, for example https://github.com/niwinz/django-redis

We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.


On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADPNjZ6bvs6d9z6pteqsgj_EzfWkbpuW-pxTtYdU7e0vveA%3Dcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Josh Smeaton
Celery explicitly document their integration with Redis though. I don't think we want to take over documenting the setup of a 3rd party package in Django.

On Thursday, 20 June 2019 11:00:27 UTC+10, Ivan Anishchuk wrote:
How about making one of the third-party packages an optional dependency? Celery, for example, does that: you can just install celery[redis] without having to figure out what other packages you need to enable redis support.

Ivan.

On Wed, Jun 19, 2019 at 6:44 AM Josh Smeaton <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="TvJ_DC60AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">josh....@...> wrote:
There are already several 3rd party packages that implement redis as a django cache backend, for example <a href="https://github.com/niwinz/django-redis" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fniwinz%2Fdjango-redis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9uNaKRb92W_syxJRAEH2JOHbv1Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fniwinz%2Fdjango-redis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9uNaKRb92W_syxJRAEH2JOHbv1Q&#39;;return true;">https://github.com/niwinz/django-redis

We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.


On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TvJ_DC60AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="TvJ_DC60AQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
Visit this group at <a href="https://groups.google.com/group/django-developers" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;">https://groups.google.com/group/django-developers.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Aymeric Augustin
In reply to this post by DULMANDAKH Sukhbaatar-2
Hello,

Until now, this feature request was always declined. As a consequence, every user who wants Redis has to choose between django-redis and django-redis-cache. Considering that Redis must be the most popular cache backend these days, I'm in favor of providing an off-the-shelf solution in Django itself. It's unlikely to be a large maintenance burden. It will "just work".

I don't know if factoring out common functionality between the memcached and redis backends will really make them easier to maintain. We'll end up with three modules (key-value, memcached and redis), which will be more complicated than two. If we had three similar backends, that would be a strong argument for factoring out common functionality. With only two backends, it may not be worth the complexity.

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.

Best regards,

-- 
Aymeric.



On 17 Jun 2019, at 17:11, Dulmandakh Sukhbaatar <[hidden email]> wrote:

Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3a506133-f08a-4d25-a9c5-099aae3722d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/F93AED93-32FC-4BF4-BDA7-48B4A76A8314%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Loïc Bistuer

I’m also +1 on having it as part of core given how prominent Redis is.

 

I agree with Aymeric that it shouldn’t be Django’s responsibility to provide or wrap advanced Redis functionalities but I think it would be lovely if we at least exposed the connection/client as a public API.

 

Regards,

Loïc

 

From: "[hidden email]" <[hidden email]> on behalf of Aymeric Augustin <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, 20 June 2019 at 15:35
To: "[hidden email]" <[hidden email]>
Subject: Re: Redis cache support in core

 

Hello,

 

Until now, this feature request was always declined. As a consequence, every user who wants Redis has to choose between django-redis and django-redis-cache. Considering that Redis must be the most popular cache backend these days, I'm in favor of providing an off-the-shelf solution in Django itself. It's unlikely to be a large maintenance burden. It will "just work".

 

I don't know if factoring out common functionality between the memcached and redis backends will really make them easier to maintain. We'll end up with three modules (key-value, memcached and redis), which will be more complicated than two. If we had three similar backends, that would be a strong argument for factoring out common functionality. With only two backends, it may not be worth the complexity.

 

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.

 

Best regards,

 

-- 

Aymeric.

 

 



On 17 Jun 2019, at 17:11, Dulmandakh Sukhbaatar <[hidden email]> wrote:

 

Hello,

 

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

 

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

 

Thanks.

 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/3a506133-f08a-4d25-a9c5-099aae3722d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/F93AED93-32FC-4BF4-BDA7-48B4A76A8314%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/SG2PR06MB2618FE99016D6B6AE043C03AA4E40%40SG2PR06MB2618.apcprd06.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Ivan Anishchuk
In reply to this post by Josh Smeaton
I wouldn't say it's that complicated a setup. It would require a single settings snippet -- just like the ones for other backends -- and, I guess, a link to django-redis docs for more details (if django-redis is what we recommend), maybe a quick explanation of what is CLIENT_CLASS and other options. While it would add some maintenance burden (occasionally checking whether any breaking changes were introduced in the 3rd party package that require updating settings) it's still way easier than adding a backend to django core.

While I agree with others about redis being popular and adding such a backend in django being a good idea (I would love if that happened) I understand the reasons for not doing it. A recommendation of a 3rd party package + setup documentation, on the other hand, is pretty simple thing to do.

If we want, it's also not very hard to provide `django.core.cache.backend.redis.Redis Cache` that depends on django-redis and is an alias for `django_redis.cache.RedisCache` -- it's basically the way it works with DB backends, I don't see why it wouldn't be a good idea for cache as well.

Ivan.

On Thu, Jun 20, 2019, 04:02 Josh Smeaton <[hidden email]> wrote:
Celery explicitly document their integration with Redis though. I don't think we want to take over documenting the setup of a 3rd party package in Django.

On Thursday, 20 June 2019 11:00:27 UTC+10, Ivan Anishchuk wrote:
How about making one of the third-party packages an optional dependency? Celery, for example, does that: you can just install celery[redis] without having to figure out what other packages you need to enable redis support.

Ivan.

On Wed, Jun 19, 2019 at 6:44 AM Josh Smeaton <[hidden email]> wrote:
There are already several 3rd party packages that implement redis as a django cache backend, for example https://github.com/niwinz/django-redis

We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.


On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
Hello,

I would like to work on Redis support in core, and I would like to discuss proper solution for that.

Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Markus Holtermann
Hi all,

may I suggest that django-redis may be "promoted" to an official Django package under the Django GitHub organization? This would follow https://github.com/django/deps/blob/master/final/0007-official-projects.rst . The package would be pointed out explicitly in the Django docs but would be shipped outside of Django.

The benefit with 3rd party packets is their shorter release cycle. Which, in the context of django-redis could be beneficial .

/Markus

On Fri, Jun 21, 2019, at 2:43 PM, 'Ivan Anishchuk' via Django developers  (Contributions to Django itself) wrote:

> I wouldn't say it's that complicated a setup. It would require a single
> settings snippet -- just like the ones for other backends -- and, I
> guess, a link to django-redis docs for more details (if django-redis is
> what we recommend), maybe a quick explanation of what is CLIENT_CLASS
> and other options. While it would add some maintenance burden
> (occasionally checking whether any breaking changes were introduced in
> the 3rd party package that require updating settings) it's still way
> easier than adding a backend to django core.
>
> While I agree with others about redis being popular and adding such a
> backend in django being a good idea (I would love if that happened) I
> understand the reasons for not doing it. A recommendation of a 3rd
> party package + setup documentation, on the other hand, is pretty
> simple thing to do.
>
> If we want, it's also not very hard to provide
> `django.core.cache.backend.redis.Redis Cache` that depends on
> django-redis and is an alias for `django_redis.cache.RedisCache` --
> it's basically the way it works with DB backends, I don't see why it
> wouldn't be a good idea for cache as well.
>
> Ivan.
>
> On Thu, Jun 20, 2019, 04:02 Josh Smeaton <[hidden email]> wrote:
> > Celery explicitly document their integration with Redis though. I don't think we want to take over documenting the setup of a 3rd party package in Django.
> >
> > On Thursday, 20 June 2019 11:00:27 UTC+10, Ivan Anishchuk wrote:
> >> How about making one of the third-party packages an optional dependency? Celery, for example, does that: you can just install celery[redis] without having to figure out what other packages you need to enable redis support.
> >>
> >> Ivan.
> >>
> >> On Wed, Jun 19, 2019 at 6:44 AM Josh Smeaton <[hidden email]> wrote:
> >>> There are already several 3rd party packages that implement redis as a django cache backend, for example https://github.com/niwinz/django-redis
> >>>
> >>> We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.
> >>>
> >>>
> >>> On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
> >>>> Hello,
> >>>>
> >>>> I would like to work on Redis support in core, and I would like to discuss proper solution for that.
> >>>>
> >>>> Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.
> >>>>
> >>>> Thanks.
>
> >>>  --
> >>>  You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> >>>  To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> >>>  To post to this group, send email to [hidden email].
> >>>  Visit this group at https://groups.google.com/group/django-developers.
> >>>  To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com <https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>>  For more options, visit https://groups.google.com/d/optout.
>
> >  --
> >  You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> >  To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> >  To post to this group, send email to [hidden email].
> >  Visit this group at https://groups.google.com/group/django-developers.
> >  To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com <https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >  For more options, visit https://groups.google.com/d/optout.
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "Django developers (Contributions to Django itself)" group.
>  To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
>  To post to this group, send email to
> [hidden email].
>  Visit this group at https://groups.google.com/group/django-developers.
>  To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com <https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>  For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9c0f7244-28d4-4f8e-a7b0-05d32ae54949%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Redis cache support in core

Josh Smeaton
Markus, I'd prefer that approach over vendoring a more incomplete solution. Bonus points if we can add packages to extra_requires, so that `pip install Django[redis]` would work nicely.

On Friday, 21 June 2019 23:17:25 UTC+10, Markus Holtermann wrote:
Hi all,

may I suggest that django-redis may be "promoted" to an official Django package under the Django GitHub organization? This would follow <a href="https://github.com/django/deps/blob/master/final/0007-official-projects.rst" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdeps%2Fblob%2Fmaster%2Ffinal%2F0007-official-projects.rst\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFE8-LsTgn2GHgkGRkSbZS3R-zxvw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdeps%2Fblob%2Fmaster%2Ffinal%2F0007-official-projects.rst\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFE8-LsTgn2GHgkGRkSbZS3R-zxvw&#39;;return true;">https://github.com/django/deps/blob/master/final/0007-official-projects.rst . The package would be pointed out explicitly in the Django docs but would be shipped outside of Django.

The benefit with 3rd party packets is their shorter release cycle. Which, in the context of django-redis could be beneficial .

/Markus

On Fri, Jun 21, 2019, at 2:43 PM, 'Ivan Anishchuk' via Django developers  (Contributions to Django itself) wrote:

> I wouldn't say it's that complicated a setup. It would require a single
> settings snippet -- just like the ones for other backends -- and, I
> guess, a link to django-redis docs for more details (if django-redis is
> what we recommend), maybe a quick explanation of what is CLIENT_CLASS
> and other options. While it would add some maintenance burden
> (occasionally checking whether any breaking changes were introduced in
> the 3rd party package that require updating settings) it's still way
> easier than adding a backend to django core.
>
> While I agree with others about redis being popular and adding such a
> backend in django being a good idea (I would love if that happened) I
> understand the reasons for not doing it. A recommendation of a 3rd
> party package + setup documentation, on the other hand, is pretty
> simple thing to do.
>
> If we want, it's also not very hard to provide
> `django.core.cache.backend.redis.Redis Cache` that depends on
> django-redis and is an alias for `django_redis.cache.RedisCache` --
> it's basically the way it works with DB backends, I don't see why it
> wouldn't be a good idea for cache as well.
>
> Ivan.
>
> On Thu, Jun 20, 2019, 04:02 Josh Smeaton <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="5JMq7vkqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">josh....@...> wrote:
> > Celery explicitly document their integration with Redis though. I don't think we want to take over documenting the setup of a 3rd party package in Django.
> >
> > On Thursday, 20 June 2019 11:00:27 UTC+10, Ivan Anishchuk wrote:
> >> How about making one of the third-party packages an optional dependency? Celery, for example, does that: you can just install celery[redis] without having to figure out what other packages you need to enable redis support.
> >>
> >> Ivan.
> >>
> >> On Wed, Jun 19, 2019 at 6:44 AM Josh Smeaton <[hidden email]> wrote:
> >>> There are already several 3rd party packages that implement redis as a django cache backend, for example <a href="https://github.com/niwinz/django-redis" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fniwinz%2Fdjango-redis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9uNaKRb92W_syxJRAEH2JOHbv1Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fniwinz%2Fdjango-redis\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9uNaKRb92W_syxJRAEH2JOHbv1Q&#39;;return true;">https://github.com/niwinz/django-redis
> >>>
> >>> We already have a base class for cache backends - and several implementing it (such as memcache). I don't think there's much benefit taking on another backend when it's already got very good support as an external package.
> >>>
> >>>
> >>> On Tuesday, 18 June 2019 01:14:25 UTC+10, Dulmandakh Sukhbaatar wrote:
> >>>> Hello,
> >>>>
> >>>> I would like to work on Redis support in core, and I would like to discuss proper solution for that.
> >>>>
> >>>> Redis is getting so popular and almost every modern backend stack uses it someway, therefore I think that supporting it as a cache backend in core would make Django more appealing. A solution I'm proposing is to extract base KV backend from current Memcached and extend it for both Memcached and Redis, and this won't add many new code to the core. Also we'll have base class for KV storage backends.
> >>>>
> >>>> Thanks.
>
> >>>  --
> >>>  You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> >>>  To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> >>>  To post to this group, send email to [hidden email].
> >>>  Visit this group at <a href="https://groups.google.com/group/django-developers" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;">https://groups.google.com/group/django-developers.
> >>>  To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com <<a href="https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-developers/bdb84d20-0489-4ecd-b198-fa5878f5c617%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>>  For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>
> >  --
> >  You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> >  To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5JMq7vkqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
> >  To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5JMq7vkqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
> >  Visit this group at <a href="https://groups.google.com/group/django-developers" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;">https://groups.google.com/group/django-developers.
> >  To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com <<a href="https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-developers/335b087c-801a-452b-a5b3-a9711e4a00b8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >  For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "Django developers (Contributions to Django itself)" group.
>  To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5JMq7vkqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
>  To post to this group, send email to
> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5JMq7vkqAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-d...@googlegroups.com.
>  Visit this group at <a href="https://groups.google.com/group/django-developers" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-developers&#39;;return true;">https://groups.google.com/group/django-developers.
>  To view this discussion on the web visit
> <a href="https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com&#39;;return true;">https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com <<a href="https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-developers/CADPNjZ5rU9wxFg_FCohJaO9%3DaA8wZ1PSyhx580BUZ6-Xr2BVDA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>  For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/0e71e262-d7d6-4323-af64-359eada8c8fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.