How do you choose between two database systems as popular as PostgreSQL vs MySQL, each of which boasts unrivalled credentials in addition to recognized qualities: processing speed, large community, support for multiple languages... What should you choose? Here are some answers.
If you’re going to build a company’s relational database management system (RDBMS), the first thing to do is to select a given environment. This is not an easy decision in itself, as it will affect the future of the company in question, which will have to deal, if all goes according to plan, with an a priori unpredictably huge number of customers, products, suppliers… Will the RDBMS that worked with excellent response times when the site had 10,000 visitors a day be able to stand up to the shock when the million mark is passed? A social network like Friendster, extremely popular in 2004, collapsed because it couldn’t cope with the unexpected influx of members.
A somewhat adventurous developer might be tempted by a relatively recent but popular solution like Snowflake. But in reality, for most, the dilemma will come down to a choice between two behemoths: PostgreSQL vs MySQL. Two well-established blue chips, teeming with quality. So how do you decide which one is best suited to your project?
PostgreSQL, one of the world's oldest database systems
PostgreSQL is the oldest of the lot. It was born at the University of California in 1989, as the result of the work of a team including a leading DBMS specialist, Michael Stonebraker, on the basis of the legendary Ingres, Oracle’s main competitor at the time.
Its popularity stemmed from a number of factors:
- open source with a particularly flexible license,
frequent updates, - customizability, such as user-defined functions,
- a wide range of data types, all of which can be defined in the same way
- various types of indexing,
- excellent scalability (ability to grow with increasing data volumes)
- a strong community of active users.
This RDBMS has become the backbone of many famous Web applications: Facebook, Instagram, Spotify, Etsy, IMDB… It has also been adopted by companies such as Apple and Sun Microsystems.
What is MySQL?
You’d think that all bets were off. But MySQL has little to envy PostgreSQL. First released in 1995, it was the brainchild of Swedish computer scientist Michael ‘Monty’ Widenius and his team at MySQL AB in Finland. Its success was so great that the company was absorbed by Sun Microsystems in 1998 and then by Oracle in 2010.
Its key strengths include:
- open source,
- easy to learn,
- low cost,
- the ability to manage vast datasets with velocity,
- proven stability,
- scalability options,
- maintenance by Oracle itself, with frequent updates,
- a community of users ready to help those with questions.
In terms of references in PostgreSQL vs MySQL, MySQL also boasts a number of prestigious names. WordPress, for example, is based on this RDBMS. It is used by Netflix, Twitter, Google (notably for YouTube), NASA, Wikipedia, Uber, the US Navy…
PostgreSQL vs MySQL: What is the difference between the two database systems?
So who to choose between these two stars, PostgreSQL vs MySQL? A few criteria can be set out.
Ease of use
If ease of use is a key factor for you, then MySQL is the way to go. It has a reputation for being easy to install and optimize. What’s more, it’s easy to find database admins with MySQL experience. PostgreSQL, by comparison, will require more technical expertise.
Operating speed
It’s not easy to separate these two behemoths on this criterion. MySQL is fast on highly concurrent functions and read-only. But PostgreSQL is better at handling complex queries and huge loads. In fact, some benchmarks favor one or the other. However, MVCC (multi-version concurrency control) appears to be PostgreSQL’s strong point, even though MySQL offers MVCC via the InnoDB engine.
Compatibility
Both SGDBRs are compatible with the main programming languages. However, PostgreSQL appears to be a little better equipped. And it’s based on an object-oriented programming language, which offers more possibilities. As for operating systems, we find the essentials (Windows, MacOS, Linux) on both sides, as well as Solaris.
Scalability
MySQL can integrate data from numerous storage engines. However, PostgreSQL was designed from the outset to manage very large volumes of data. Adjust.com uses it to manage 4 Petabytes of data, and reports brilliant performance.
Support
MySQL has a larger community ready to contribute. PostgreSQL also has a large community, but support is less readily available, according to the G2 review site.
Conclusion: PostgreSQL vs MySQL
So, which to choose? PostgreSQL has more features than MySQL, so it’s better suited to handling “extraordinary” situations, i.e. complex queries on ultra-voluminous databases. If, on the other hand, you’re looking for a database that’s reliable but simpler to use, MySQL would appear to be the best choice.