Comparing MySQL and PostgreSQL
MySQL and PostgreSQL are two of the more powerful open-source database management systems on the market. In this article, we will take a look at both DBMSs and, by the end, you should come out with a firm understanding of the strengths and weaknesses of each, and will then be able to sensibly decide which is best to use in your circumstance. The point of this article is not to bore you with technical intricacies; rather, I bring you a simple, yet practical, easy to understand analysis. So, which DBMS is better? Remember, this question cannot be answered without profound insights into your requirements. I certainly cannot do that for you, but I can provide you with enough information to facilitate your own deeper analysis of your own needs.
The short answer
For those in search of a short and sweet answer, here it is. In most cases, you will find MySQL faster than PostgreSQL. If, however, a variety of business rules must be implemented within your database, Postgre is probably the better solution, because it supports features like triggers and stored procedures, something MySQL does not support as of version 4. If you are looking for a simple, but quick database to drive your web site, choose MySQL. If your requirements include more complex database interactions, pay attention to Postgre.The longer answer
When performance matters: If performance is your main consideration, MySQL should be your DBMS of choice. Although MySQL's feature line-up falls short against Postgre's, MySQL wins in the arena of speed.When features matter: No question about it, Postgre offers more features, including stored procedures, triggers and a procedural language. Postgre also supports subqueries, views, unions, full joins and constraints. These capabilities are used to capture and ensure business rules within the database.
When transactions matter: Transactions are a feature that Postgre supports, and only in MySQL when InnoDB table type is used. Think of a transaction as a fence that surrounds a series of database steps; it separates this group of processes into its own little world. The transaction encapsulates these steps and makes the concept of rollbacks easy. For example, a transaction may not be saved unless ALL steps are completed successfully. If even one step fails, the entire transaction is rolled back, and no database changes occur.
When table types matter: One feature that MySQL supports is table types. Those tables include MyISAM (default), Merge, ISAM, Heap, InnoDB and BDB. Each table provides slightly different capabilities. Refer to MySQL documentation for more on table types.
MySQL and PostgreSQL are two different animals. MySQL is fairly lightweight and provides extremely fast database processing while neglecting the features provided by Postgre. Postgre, on the other hand, runs slower but models a true, powerful relational DBMS closer with its support of integral features many businesses are in search of. Think of Postgre as the Oracle of open-source databases. The future appears brighter for MySQL fans. MySQL 5 is said to support many of the features of Postgre, including views, constraints and triggers. Whether this will impede the speed of MySQL is unknown, but it emerges as probable in my mind.
Quick summary
Reasons to select MySQL:
Reasons to select Postgre:
You should now be able to make a reasonable decision about your database of choice, whether your task is to database-back a fairly small, simple web site, or a database to drive a powerful and complex system of business features.
Author: Steve - steve@WebSiteGravy.com .