Home Links

MySQL against PostgreSQL

Me often ask, « That you prefer,

PostgreSQL or MySQL? » My answer always same: « It - a question

Preferences ». You can set to set of other developers the same

The question, and their answers will be rather various sense. - comparison of databases

MySQL and PostgreSQL, offered{suggested} not for the sake of the statement of my opinion, and for the sake of that,

To help anothers to make own decision.

To both systems is what to offer in questions of stability, flexibility and

Productivity. MySQL has features in which PostgreSQL tests

Lack, and on the contrary. My primary problem  - to help to solve, what from these two

Databases it will be used in your own development.

Before to begin comparison of these databases, I should clear, that I shall be

To adhere to the installations set by default. MySQL has a lot of various

Types of tables which support tranzakacii and external keys. However,

Some from configurations of these types of tables are rather complex . Not many

Developers of a network or programmers use additional types of tables,

Existing in MySQL. And now let's compare these two products.

The list of features and opportunities


In the table And comparison most upotrebimykh features is resulted and

Opportunities of databases MySQL and PostgreSQL.

The table And is not the exhaustive list of features, types of the data or

Problems of the productivity, concerning these two systems of databases - she only

Gives some performance that each of them can offer. From

We see tables, that PostgreSQL offers full features and opportunities

Traditional applications of databases while MySQL it is focused on

Faster performance (job) for a web of applications. Development of the industry

« Open source codes » will bring a lot of features and opportunities in

The subsequent versions of both databases.


Table A: comparison MySQL and PostgreSQL

Features         PostgreSQL         MySQL

ANSI SQL compatibility         Is close to standard ANSI SQL         Follows some standards ANSI SQL

Speed of job         More slowly         Faster

Enclosed selekty         Yes         No

Tranzakacii         Yes         Yes, the type of table InnoDB however should be used

The answer of a database         Yes         Yes

Support of external keys         Yes         No

Performances         Yes         No

Stored{Kept} procedures         Yes         No

Triggers         Yes         No

Unions         Yes         No

Full Joins         Yes         No

Terminators of integrity         Yes         No

Support Windows         Yes         Yes

Vacuum (clearing)         Yes         No

ODBC         Yes         Yes

JDBC         Yes         Yes

Various types of tables         No         Yes


When to use MySQL


Why you would prefer MySQL, rather than PostgreSQL? First, we should

To consider needs{requirements} of applications for terms of requirements of a database. If I

I want to create a web the application, and the main thing for me is productivity and

Speed - MySQL will be the best choice because she is fast and developed for

That it is good to work about a web as servers. However, if I want to create another

The application which demands performance tranzakacij and presence of external keys,

The best choice becomes PostgreSQL.

Even at that MySQL is not completely compatible with ANSI SQL the standard, I

Should mention, that while PostgreSQL is closer to ANSI SQL to the standard,

MySQL is closer to ODBC to the standard.

Let me to describe some pluss of use MySQL:

?         MySQL is rather faster PostgreSQL.

?         The design and planning of a database is a little bit easier.

?         It is possible to create a simple web a site with use of base.

?         Answers to searches MySQL were well tested.

?         There is no need to use methods of clearing (vacuum).


When to use PostgreSQL


Not many webs - developers use in job PostgreSQL, as

Consider, that additional features and opportunities reduce productivity

And speed of job. However, PostgreSQL has many advantages above MySQL.

For example, some from features which often are used - external

Keys, triggers and performances. They allow to hide complexity of a database from

Applications, thus avoiding creation of complex  SQL. CT``SJAFuTSF commands it is a lot of

Developers who prefer rich functionalities SQL

PostgreSQL commands. One of the most appreciable distinctions between MySQL and PostgreSQL-

Impossibility of creation of the enclosed subrequests (selektov) in MySQL. PostgreSQL

Corresponds{Meets} many SQL to standards ANSI, thus allowing creation

Complex  SQL commands.

Some reasons to use PostgreSQL:

?         Complex  design of a database.

?         Crossing{Moving} with Oracle, Sybase or MSSQL.

?         Complex  sets of rules.

?         Use of procedural languages on the server.

?         Tranzakacii

?         Use of stored{kept} procedures.

?         Use geografichekikh the data.

?         R-Trees (for example, use of indexes).


The conclusion


You should choose, having weighed all pluss and minuses, what database

Is "accomplished{perfect}" for your application or a site. And can be and such,

That you want to use both bases (there are also such cases). My conclusion-

One base not necessarily is better another, and each of them borrows{occupies} the opredelenuju

Niche in the world of databases with an open initial code.