Question

MySQL vs redis for wordpress website

If you have a choice to select and you only have 15 dollars then what would you go for my SQL or redis manage digital ocean server. Assuming i have droplet with all things installed and i am migrating to respective server


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

MySQL is a must for WordPress, but Redis is optional.

Redis is typically used as an object-cache backend in WordPress, which requires some configuration, as well as deep knowledge about your application (plugins, themes, etc.) so it adds additional complexity to your stack, even if it’s managed.

There is also no guarantee that your WordPress site will actually benefit with a persistent object cache, such as Redis. In a lot of cases it will actually hurt due to the amount of round-trips to a remote Redis instance or cluster.

The best course of action would be to test, perhaps with a Redis instance locally. Try it out, use profiling tools such as Xhprof (or even the Query Monitor plugin) to find out whether it’s reducing the response times, and look at your Redis hit-rate, amount of gets/sets per request, etc. And keep in mind that there will be latency when going remote.

If you haven’t heard about object caching in WordPress, here’s a good start:

https://developer.wordpress.org/reference/classes/wp_object_cache/

Cheers!

Hi @cloudcreatr,

I’ll try to add some more to the previous reply.

As already explained, MySQL is something you can’t get away from when using WordPress. MySQL is the main database of your WordPress website.

Having said that, Redis is as mentioned used as an object-cache backend. Usually, Redis is used when you have a really heavy website with a lot of information being dynamically passed/loaded on every click. What Redis would do in such cases is to store some information inside itself and not do MySQL queries or such heavy MySQL queries.

With that in mind, using Redis should be really for some specific cases rather than an option for every website. If you are not seeing any bad performance on your website then using Redis will not improve the speed/performance.