Understanding MySQL in WordPress

Posted: August 29, 2013 Comments

View http://scotty-t.com/2012/01/30/understanding-mysql-in-wordpress/

Like most things in WordPress, SQL “just happens,” and you don’t have to know anything about it beforehand to start working with WP. You could actually go your entire life using WordPress and never once need to know anything about SQL. That’s if your entire life using WordPress is in a lightweight manner – a personal blog that doesn’t need to scale. The second you start “needing to scale” is the second you start “needing to know SQL.”

I like this post for a number of reasons. First, it’s wicked comprehensive and talks a lot about the WordPress database level in a way I wish I read a long time ago. When I started working with WordPress the idea of writing SQL scared me to death. My ignorance had me convinced that it was trivial to destroy a database at any point in time, and while there’s some (slight) truth to that, it’s no different than working with WordPress theme files in a sense. The way to destroy a file is to overwrite it or delete it, there’s some intention there. But I digress.

This article is great because it does call out the fact that WordPress does most of the SQL for you, which is awesome, it should do that, and it does a fantastic job with it. That does not mean, however, that we’re all excused from at least kind of knowing what’s going on under the hood, even if we’re not writing the SQL itself. There will be a time where you need to change something that’s so unique WordPress doesn’t have a built in function to handle it for you, be prepared for that.

As outlined in the article, the most common time this comes up is when you’re working on a well-trafficked site that just doesn’t scale at a certain point. You can tinker around quite a bit and massage WordPress’ database functions to overcome that hurdle, it just takes a bit of context.

Get my newsletter

Receive periodic updates right in the mail!
  • This field is for validation purposes and should be left unchanged.

Leave a Reply

Your email address will not be published. Required fields are marked *