52

I noticed that there are two different projects for using redis for django cache

https://github.com/sebleier/django-redis-cache/

https://github.com/niwibe/django-redis

Is one better known than the other, more of a standard package? I can't decide which to use.

aris
  • 22,725
  • 1
  • 29
  • 33

1 Answers1

34

I am currently using django-redis as cache backend for Redis. I haven't used django-redis-cache so far, but what made me take the decision to use django-redis are the following:

  • Modular client system (pluggable clients).
  • Some of the pluggable clients come out of the box (shard client, herd client, etc.)
  • Master-Slave support in the default client.
  • Facilities for raw access to Redis client/connection pool (very useful).
  • Better documented.

On django-redis documentation site, you can find more reasons to consider it. What I can tell from my experience so far is that I am very happy with django-redis.

Francisco
  • 10,918
  • 6
  • 34
  • 45
Martin
  • 1,078
  • 1
  • 14
  • 18
  • 8
    `django-redis` also supports redis locks (handy for Celery) and redis `NX` commands, however `django-redis-cache` supports `get_or_set` and possibly uses `NX` internally to support `add`. Both support `incr` and `decr` although the `django-redis` doesn't document it very well. I'd say `django-redis-cache` is better documented and better follows Django's own cache API (eg, supporting `get_or_set`) so switching from/to other cache backends might be easier with `django-redis-cache`. django-redis permits compression only for large objects, django-redis-cache supports different compression levels. – Chris Jan 26 '16 at 13:03
  • some profiling stats would be nice...or at least a decision for production? – davesave Jun 15 '16 at 21:02
  • 1
    Just two comments more: According to [this reddit thread](https://www.reddit.com/r/django/comments/5qk11a/djangoredis_vs_djangorediscache/), 9 months ago `django-redis-cache` had 728 starts. Now it has 793 stars. `django-redis` had 737 stars, now it has 958 stars. Also, it says that "`django-redis` is in active development and `django-redis-cache` is not". – Niko Föhr Nov 14 '17 at 11:08
  • 1
    Additionally, django-redis also supports versioning – velis Dec 19 '18 at 18:19
  • thanks for these updates guys, this really helped me in a pinch – Dash Winterson Apr 27 '20 at 13:27