Among the things I’m sometimes asked by new webmasters are “What is MySQL?”, “What is SQL” and “What is a database?”. These questions arise because such terms tend to surface all over the place in connection with the creation of a website. This article explains them in (hopefully) plain English.
Who is This Article For?
This article is written from the point of view of a webmaster and is directed at potential webmasters (or existing webmasters) who are suddenly confronted by cryptic terms like “MySQL database” or “PostgreSQL database” and the like.
It is not meant to be a rigorous academic definition for programming students. If you are one, you should consult a programming book for the proper definition. The explanation below is meant for the layperson who sees these terms pop up in places like web hosts’ feature lists and the “System Requirements” lists for various web software like PHP scripts, and wonder what it means, and whether it’s something that they need to be worried about. In other words, this guide is meant for a non-technical audience seeking to get the big picture and see if it is relevant to them.
What is a Database?
Before I can answer what MySQL means, I have to explain what a computer “database” means.
Essentially, where computers are concerned, a database is just a collection of data. specialized database software, like MySQL, are just programs that lets you store and retrieve that data as efficiently as possible.
A little analogy may help make it clearer why we use specialised database software. Think about the documents stored on your computer. If you were to save all your documents using a (brain-dead) file naming scheme like “1.doc”, “2.doc”, “3.doc”, … “9,999,999.doc” (etc), you will eventually face a problem of finding the right file if you’re looking for a specific document. For example, if you’re looking for a business proposal you made some time ago to XYZ Company, which file should you open? One way is to sequentially check every single file, starting from “1.doc”, till you get the right data. But this is obviously a highly inefficient method of getting the right file. And it’s primarily the result of an inefficient method of storing your data (ie, saving your files) in the first place.
Now, this is of course a ridiculous example. I mean, no one I know saves files with names like these, and even if so, there are many search software that can help you locate the correct file without your having to manually open every single one in sequence. But it serves to make the point that once you have a lot of data, if you don’t have a good system of organising it, finding the correct piece of data is a very time consuming operation. And it becomes more time consuming as the amount of data grows.
A database program is a type of computer software that is designed to handle lots of data, but to store them in such a way that finding (and thus retrieving) any snippet of data is more efficient than it would have been if you simply dumped them willy nilly all over the place. With such a database software, if you (say) keep a list of customers and their shipping addresses, entering and retrieving information about your one millionth customer will not take much longer (if at all) than entering and retrieving information about your 1st customer.
What is SQL? What is MySQL? What is PostgreSQL?
Many computer programs, including web-based programs like blogs, photo galleries and content management systems need to store and retrieve data. For example, blog software need to store the posts (ie, articles) you write, and retrieve them when a visitor goes to your site. Similarly, photo galleries store information about their pictures (for example, for sites that allow users to rate the photos, the numerical rating for each picture is stored in a database). Instead of reinventing the wheel and implementing their own system of storing and retrieving data, these software simply use the specialised database programs I mentioned earlier.
To make it easy for other programs to access data through them, many database software support a computer language called “SQL” (often pronounced as “sequel”). SQL was specially designed for such a purpose. Programs that want the database software to handle the low-level work of managing data simply use that language to send it instructions.
There are many databases that support the use of SQL to access their data, among them MySQL and PostgreSQL. In other words, MySQL is just the brand of one database software, one of many. The same goes for PostgreSQL. These two databases are very popular among programs that run on websites (probably because they are free), which is why you often see one or both of them being advertised in the feature lists of web hosts, as well as being listed as one of the “system requirements” for certain web software (like blogs and content management systems).
Do I Need to Know Which is Better?
For the average webmaster, one who is not writing computer programs for their websites, the pros and cons of MySQL versus PostgreSQL or some other database are not important. All you need to be concerned about is whether your web host provides the database software that your web application needs. Generally, if you use one of the popular blogging software or CMS software, this will often be MySQL. In fact, since practically every commercial web host provides MySQL as part of one or more of its hosting packages, chances are that you probably don’t even have to worry about this.
Do I Need It?
As mentioned in the previous section, if you use a blogging or CMS software (like WordPress, Drupal or Expression Engine), you will need to place your website on a web host that provides you with a MySQL database. The database will be used by the software to store all your posts (articles), web pages and visitors’ comments.
If, on the other hand, your website was created using a web editor like Dreamweaver or BlueGriffon, and you did not integrate a blog or some other web-based software into your site, chances are that you don’t need MySQL. In any case, if you’re not sure, you can always check the “system requirements” page for the software that you want to use to find out whether you’ll need MySQL.
(Before you ask, the feedback form generated by the Feedback Form Script Wizard does not need MySQL. Not all web-based programs require a MySQL database; only those that need to store data.)
Do I Need to Learn SQL or MySQL or Something Like That?
For the vast majority of webmasters, you don’t need to learn SQL or learn how to use MySQL, even if you’re setting up a blog. The software you use, be it WordPress or something else, will do all the dirty work of storing and retrieving your data for you. All you need to learn is how to use that particular software (eg, WordPress). Things like MySQL and other databases are like the engines of a car. Just as you don’t need to learn how to design a car engine to be able to use a car, so also you do not need to know how to directly write to or read a MySQL database to use a blogging software.
Of course, if you are a programmer, intending to write a computer program that actually accesses MySQL or some other SQL database, then you will need to learn SQL (as well as a programming language). But then, if you are one, you probably already knew that. Note for the newcomer: you don’t need to be a programmer to be a webmaster. Creating a website, even if you manually code your website directly in HTML, is not programming. So don’t worry.