Redis vs Memcached for Drupal

We have been using Memcached as the standard to speed up our Drupal internal caching. Shall we now use Redis instead?


It seems there is a new trend on the Drupal community, Redis. What made me pay attention to it is that it seems to go in detriment of Memcached.

In a nutshell:
  • Memcached does only one thing, and it does it well. Stores key/value pairs in memory.
  • Now Redis has about the same performance than Memcache storing/accessing key/value pairs, but it does much more.

This alone would make a point as to why you should use Redis if you are developing a new platform. Granted, it is more convoluted and involved to learn, but you can do much more. It also has a solid scalable architecture.

In my book the recipe goes:
  • If you are already using memcached, stick with it. I don't see a reason to change right away.
  • If you have a provider which restricts you to either of them, just follow their lead. Best to have key-value server for cache than using the main database. No matter if it is Memcached or Redis, use what ever they provide.
  • If you are not using either of them, just choose one and use it. Both will do the trick.

For Drupal7 both modules are stable: memcache and Redis. I have some details on how to configure memcache module in this Drupal performance presentation (in spanish), but there are lots of articles on how to do it online.

If you are using Drupal8 or you are doing a new development that could benefit from in-memory key-value cache and store I would look into using Redis. There are alpha versions of the Drupal integration modules for either of them.

Important fact about major players: Acquia only supports Memcached. Pantheon and Platform only support Redis.

If you want to know more about Redis I can recommend: