The current version of MYSQL/MARIADB is 5.7.6 (mariadb is a MySQL branch created by the MySQL creator Monty Widenius), and the version of PostgreSQL is 9.4.1.
The following aspects compare the latest versions of both:
- ANSI standard compatibility: MySQL has made great strides compared to previous versions, but the philosophy behind MySQL is that if customers like it, they will support non-standard extensions, and PostgreSQL will build standards into the platform from the start. However, the difference is not very different;
- Acid compliance: PostgreSQL has one storage engine, while MySQL has 9, but only MyISAM and InnoDB are related to most users, the latter being the default storage engine. InnoDB and PostgreSQL are fully acid-compliant, with little difference;
- No lock Table modification: MyISAM uses table-level locks to increase speed, which results in write mutexes. But PostgreSQL and InnoDB all use row-level lock, the difference is not big;
- Subquery: For a long time, this has been a weakness of MySQL, although 5.6.5 made a significant improvement, but PostgreSQL support table connection is better, especially MySQL does not support the full outside connection, therefore, this aspect of PostgreSQL better than MySQL;
- JSON support and Nosql:postgresql have recently added JSON support, which provides greater data storage flexibility than a traditional relational database, so PostgreSQL trumps MySQL.
Current Benefits of PostgreSQL:
- Better licensing: PostgreSQL uses an MIT-like license agreement that allows developers to do anything, including commercial in open source or closed sourced products, while MySQL clients follow the GPL license agreement, so developers must pay Oracle or open up their own applications;
- Better data consistency: PostgreSQL will be rigorously validated before data is inserted and updated to ensure that the data is valid for the appropriate operation, but in MySQL, developers need to set the server to strict SQL mode to achieve the same goal, otherwise it may produce irregular data;
- Server Extensions: MySQL provides plug-in API, supports C/C + + or any compatible language, and starts with the 5.7.3 version to support full-text search, PostgreSQL has a similar system but supports more languages, including C + +, Java,. Net, Perl, Python, Ruby, TCL, ODBC, and so on, it can even run user-supplied code in a separate process; In addition to the general information about databases, tables, and columns contained in all relational databases, the PostgreSQL system catalog can also contain data types, Information about functions and access methods that developers can use to modify this information to implement extensions.
Mysql Postgresql Throw-away performance comparison