MySQL vs PostgreSQL

Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

MySQL
MySQL

23.7K
18.3K
+ 1
3.7K
PostgreSQL
PostgreSQL

17.3K
13.1K
+ 1
3.4K
Add tool

MySQL vs PostgreSQL: What are the differences?

What is MySQL? The world's most popular open source database. The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

What is PostgreSQL? A powerful, open source object-relational database system. PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.

MySQL and PostgreSQL can be primarily classified as "Databases" tools.

"Sql", "Free" and "Easy" are the key factors why developers consider MySQL; whereas "Relational database", "High availability " and "Enterprise class database" are the primary reasons why PostgreSQL is favored.

MySQL and PostgreSQL are both open source tools. PostgreSQL with 5.38K GitHub stars and 1.79K forks on GitHub appears to be more popular than MySQL with 3.91K GitHub stars and 1.54K GitHub forks.

According to the StackShare community, MySQL has a broader approval, being mentioned in 2965 company stacks & 2944 developers stacks; compared to PostgreSQL, which is listed in 2701 company stacks and 2097 developer stacks.

What is MySQL?

The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

What is PostgreSQL?

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose MySQL?
Why do developers choose PostgreSQL?

Sign up to add, upvote and see more prosMake informed product decisions

What companies use MySQL?
What companies use PostgreSQL?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with MySQL?
What tools integrate with PostgreSQL?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to MySQL and PostgreSQL?
Oracle
Oracle Database is an RDBMS. An RDBMS that implements object-oriented features such as user-defined types, inheritance, and polymorphism is called an object-relational database management system (ORDBMS). Oracle Database has extended the relational model to an object-relational model, making it possible to store complex business models in a relational database.
MariaDB
Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry. MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.
MongoDB
MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.
Microsoft SQL Server
Microsoft® SQL Server is a database management and analysis system for e-commerce, line-of-business, and data warehousing solutions.
SQLite
SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.
See all alternatives
Decisions about MySQL and PostgreSQL
StackShare Editors
StackShare Editors
PostgreSQL
PostgreSQL
MySQL
MySQL

In 2014, Uber began working on Big Data Generation 1. Prior to 2014, all of the company’s data could fit into “a few traditional online transaction processing (OLTP) databases (in [their] case, MySQL and PostgreSQL ).” At that time, engineers were required to write individual code to access and join data across databases, a take made more difficult by the fact that there was no global view of all stored data, which was scattered around several OLTP databases with a “total data size on the order of a few terabytes.”

They chose Vertica as the analytical data warehouse, because of “because of its fast, scalable, and column-oriented design. We also developed multiple ad hoc ETL (Extract, Transform, and Load) jobs that copied data from different sources (i.e. AWS S3, OLTP databases, service logs, etc.) into Vertica.

See more
StackShare Editors
StackShare Editors
PostgreSQL
PostgreSQL
MySQL
MySQL

Uber's early architecture was a monolithic Python backend on top of Postgres. Between 2014 and 2016, Uber moved many applications off of Postgres and onto MySQL, accessed through a sharding layer built in-house called Schemaless.

As the company scaled, Uber encountered issues with scaling writes due to write amplification issues (1 logical write causing 4 physical writes) and inefficient data replication with Postgres. Postgres replication works at the physical level, which means that it's not possible to replicate data between data bases running different versions. This added complexity and risk to upgrades.

MySQL, and the InnoDB storage engine in particular, can do replication at the statement level, which poses less risks and works between versions. Uber also found MySQL's caching and connection pooling capabilities to provide superior performance for their use cases.

See more
Jake Stein
Jake Stein
CEO at Stitch · | 15 upvotes · 61K views
atStitchStitch
Clojure
Clojure
MySQL
MySQL
PostgreSQL
PostgreSQL

The majority of our Clojure microservices are simple web services that wrap a transactional database with CRUD operations and a little bit of business logic. We use both MySQL and PostgreSQL for transactional data persistence, having transitioned from the former to the latter for newer services to take advantage of the new features coming out of the Postgres community.

Most of our Clojure best practices can be summed up by the phrase "keep it simple." We avoid more complex web frameworks in favor of using the Ring library to build web service routes, and we prefer sending SQL directly to the JDBC library rather than using a complicated ORM or SQL DSL.

See more
Gregory Koberger
Gregory Koberger
MongoDB
MongoDB
MySQL
MySQL
PostgreSQL
PostgreSQL
MongoDB Atlas
MongoDB Atlas
MongoLab
MongoLab
Compose
Compose

We went with MongoDB , almost by mistake. I had never used it before, but I knew I wanted the *EAN part of the MEAN stack