python-memcached is deprecated, but still used in core Django

290 views
Skip to first unread message

Adrian Turjak

unread,
Nov 24, 2019, 6:46:05 PM11/24/19
to django-d...@googlegroups.com
A while ago now I opened a ticket that we need to deprecate the
python-memcached backend in Django, and ideally make a new one which
uses Pinterest's pymemcache instead (which is now the most commonly used
one).

This is the ticket:
https://code.djangoproject.com/ticket/29887

But it seems there hasn't been any work on it. Someone assigned
themselves, but nothing beyond that has happened.

At this stage we really need to remove the docs that recommend
python-memcached, and the backend associated with it, and say officially
that only pylibmc is a valid and safe option from the core backends
using Memcached.

Considering how important Memcached is to a lot of projects, this ought
to be a high priority item, with some urgency given that Django core is
sporting support for a now very deprecated and outdated library (Last
released: Dec 16, 2017), with no future, and a clear successor in
pymemcache.

I'm sadly not in a position where I can contribute this myself, but
would be happy to test/review. Are there any willing contributors for
this? Or some people from the Django core team which will tackle this?

Cheers,
Adrian Turjak




Jure Erznožnik

unread,
Nov 25, 2019, 3:50:52 AM11/25/19
to django-d...@googlegroups.com
I am currently attempting to involve myself more into Django
development. Have little to no idea how.

This seems to me like an easy pickings and I would be willing to port
existing code to the new package, if that's okay with the core team.

My expected approach:

1. verify claims

2. take the ticket

3. read up on the contribution guidelines

4. start with master, replace all memcached references with the new
library, possibly with minimal API impact

5. backport to 2.x, 1.x?

If this sounds remotely what's supposed to be done, let me know, I will
start working on it.

LP,
Jure

P.S. My planned involvement should ultimately reach around 200 hours of
yearly investment, should I prove to be useful. All pending verification
and validation, of course. I don't even know if that's a measurable
quantity, but right now these are my mid-term plans.

Johannes Hoppe

unread,
Nov 25, 2019, 5:05:30 AM11/25/19
to Django developers (Contributions to Django itself)
Do we actually need to deprecate the current backend and create a new one? Can't we just rewrite the current backend? Technically changing a dependency doesn't require deprecation, does it? It's also a very simply update process.

Adrian Turjak

unread,
Nov 25, 2019, 8:00:52 PM11/25/19
to django-d...@googlegroups.com

That's a tough question. It depends on when and how we do it. A new backend can potentially be backported to 2.2 (the current safe LTS), but we can't really update the existing one if people are using it and expect it to work. Django doesn't actually have any deps for these libraries, so people have to install them as part of their app deployment.

A new backend, even if mostly a copy of the old one, is the safer approach and then people need to actively switch to it, and be aware of it. We then deprecate the old one, and we can backport to 2.2 the new safe one, and remove the old one in never versions.

--
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 django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a5eaf9cc-21aa-4cb8-9d61-9fc8e76e0733%40googlegroups.com.

Mariusz Felisiak

unread,
Nov 26, 2019, 1:51:10 AM11/26/19
to Django developers (Contributions to Django itself)
TIcket #29887 doesn't qualify for a backport so if someone prepare a patch then we can include it in the Django 3.1. Also, I don't see a strong consensus for deprecating python-memcached support. It can found a new maintainer in the nearest future.

Best,
Mariusz

Adrian Turjak

unread,
Dec 8, 2019, 9:38:43 PM12/8/19
to django-d...@googlegroups.com

A backport probably isn't needed, but I strongly urge deprecation. The library has had a few failed attempts at pick up, but ultimately those who wanted to do that just moved to pymemcached, and anyone else sensible will do the same. There is no need or want to maintain python-memcached when a strong opensource alternative exists that is backed by pintrest. I reached out to some of the people who were looking at picking up maintaining it, but they never got any response back from the current project owner, and going through the hassle of getting it from them via pypi admins is a waste of time when pymemcached is the clear winner in the pure python memcached library space.

python-memcached is dead for all intents and purposes, and with no release since Dec 16, 2017 is in a bad place for us to not deprecate. As such, this is bad for us, and looks bad for Django that we still recommend this library as the first option when using memcached.

--
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 django-develop...@googlegroups.com.

Mariusz Felisiak

unread,
Nov 14, 2020, 2:34:17 AM11/14/20
to Django developers (Contributions to Django itself)
Hello,

    I think it's time to deprecate the django.core.cache.backends.memcached.MemcachedCache backend in Django 3.2 and remove it in Django 4.1, see  #32193. So if there is no strong opposition I will move it forward in the next few weeks.

Best,
Mariusz

Adam Johnson

unread,
Nov 20, 2020, 2:00:38 PM11/20/20
to django-d...@googlegroups.com
I agree that it's time Mariusz. Thank you for keeping track of and handling the deprecation, you're on top of things as always!

--
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 django-develop...@googlegroups.com.


--
Adam
Reply all
Reply to author
Forward
0 new messages