Imagine having a slow website. You’ve implemented caching to the best of your ability, and that helped, but you can’t cut the database out completely on this site. Maybe you’re running an eCommerce shop and your shop has to process an order for every customer. Maybe you’re running a membership site and a large percentage of your visitors need to view content unique to their own browsing experience. There could be a variety of reasons that you still need to query the database as visitors browse the site.
If we cannot eliminate the database completely, how can we speed it up?
Before we can tackle how to make things faster, we need to spend a bit of time understanding why they’re so slow in the first place. A partial explanation for this is the simple fact that WordPress has been around for a long time. As you likely know already, backward compatibility is paramount for a project of this scale. What this means, for us, is that we need to live with some decisions that were made a decade or more ago. Some of these decisions involve the database, and some of those can cause major headaches and slow sites. We’ll shed some light on a few of these bottlenecks and show you what to do about them.
Follow along as Gabor takes us through the current structure of the tables, their bottlenecks, and some quick fixes. He’ll teach you some of the theory and practice behind indexes in MySQL – how they work and how to use them – and then provide practical examples and tips on building data structures that allow you to scale effortlessly.