The ServerHub Blog

We are a skilled group of Internet Nerds, with a wild passion for bettering the internet. Here we share our thoughts, ideas, aspirations, and even challenges of running a global platform.

Comparing Databases: MySQL vs. PostgreSQL


Databases have come a long way since the 1970s when it was first invented. They are the backbone of every software, applications, and websites we access every day. With the technological revolution happening all around us, databases also evolved to keep up with the demands of the industry. Several prominent names have appeared since, such as Oracle, Microsoft SQL Server, IBMDb2, to name a few. In this post, we will compare two of the most well-known systems, MySQL and PostgreSQL.

MySQL has been a prominent open-source relational database figure for a long time, one can sufficiently say that it is one of the most trusted names out there. Still, competitors have been popping up ever since, after all, what is an industry without a few challenges? One of them, namely PostgreSQL (also known as Postgres), holds against MySQL. Both of them are open-source, meaning both of their source codes are under a license that lets users study, customize, and distribute the software for whatever purposes to anyone. MySQL has been in circulation since 1995, it had its latest stable release last April, meanwhile, PostgreSQL is just a year younger than the former, it has been out since 1996, and had its latest stable release last June. Recently, PostgreSQL has been gaining popularity again since large companies like White Pages changed from MySQL to Postgres when they moved core directories in-house.

In terms of who uses the two databases, MySQL is being used by various internet giants, such as WordPress, Facebook, Twitter, and YouTube and many more, while PostgreSQL is being utilized by Sony Online, Skype, Reddit, and Instagram with several others. Their real difference lies within their intended usage and features. One main factor is that MySQL is a relational database management system (RDBMS) which means that users have the ability to define, create, maintain, and control access to the database. On the other hand, PostgreSQL is an object-relational database management system (ORDBMS), this kind of system has the characteristics of both relational and object-oriented databases. Their features differ from one another too, despite being derived from SQL.

Below is a table that shows the difference between the two relational databases in terms of cross-platform support, security, data types, replication, etc.

Features MySQL PostgreSQL
Cross-Platform Solaris, Windows OS, Linux, OS X, and FreeBSD OS Solaris, Windows OS, Linux, OS X, Unix-OS and Hp-UX OS
Security Built-in security features. Offers native SSL support for encryptions.
Community Support
(DB-Engines Ranking)
#2 Overall. #4 Overall.
ACID Compliance Yes Yes
Programming Language C/C++, Erlang, PHP, Lisp, Go, Perl and others C/C++, Java, .Net, R, Perl, Python, JavaScript, and others
Replication Master-master replication. Master-slave replication.
Performance Widely used for web-based projects. Widely used for systems that performs complex queries.
SQL Partial Yes
Storage Engine Multiple Storage Single Storage
Data Types SQL-standard type Supports different advanced data types (array, hstore, user-defined).

Despite several notable differences, they both offer a similar job of how should a database work. In some cases, they might even overlap certain features, it's just up to what a project requires that the other one might not offer. Some people may lean towards MySQL because of familiarity and some may go towards Postgres for advancement. As mentioned before, MySQL and PostgreSQL are both free and open-source products but MySQL offers paid services for companies and is under GNU General Public License. PostgreSQL is under the PostgreSQL license, similar to the MIT license.

All things considered, these databases are great for their intended purposes. MySQL is best for online transactions, like e-commerce, while PostgreSQL shines through with data warehousing, like Amazon Redshift. They both excel in their own way, both can do great at SQL hosting, and ServerHub is here to ensure that it stays as it is. We have dedicated server packages for Non-Volatile Memory Express (NVMes) which enables faster data storage in Solid State Drives (SSDs), they boost performance for MySQL and PostgreSQL. This means that the better they perform, the smoother the operation goes. You wouldn't want to be caught in a situation where your database and server doesn't perform like they should be.

If you are still having troubles, you may contact our engineers to sort out your problems. We offer managed services on an hourly basis for each dedicated server, customers can utilize this service to reach them and get their expert opinion about the best solutions, installations, configuring, optimizing, fine-tuning, high-availability, backups, distributed systems, and migrating databases to our platform. Our highly-valued engineers can also help you build advanced solutions such as SQL clustering. Reach them anywhere, 24/7.

comments powered by Disqus