When to use Redis instead of MySQL for PHP applications?

james.bcn picture james.bcn · Oct 19, 2010 · Viewed 51.5k times · Source

I've been looking at Redis. It looks very interesting. But from a practical perspective, in what cases would it be better to use Redis over MySQL?

Answer

Martin Wickman picture Martin Wickman · Oct 19, 2010

Ignoring the whole NoSQL vs SQL debate, I think the best approach is to combine them. In other words, use MySQL for for some parts of the system (complex lookups, transactions) and redis for others (performance, counters etc).

In my experience, performance issues related to scalability (lots of users...) eventually forces you to add some kind of cache to remove load from the MySQL server and redis/memcached is very good at that.