1 min read

Which database to select for a new project?

Which database to select for a new project?
Photo by Photos By Beks / Unsplash

This a question I have heard a few times in interviews actually. This time it was from an old friend curious about my choice for new projects.

My answer was quick: PostgreSQL.

PostgreSQL is a long-running OpenSource project with a large community of developers and supporters. It has a large base of users of all sizes and use cases. Thanks to some investments in the last 10 years it has grown even more stable and powerful than it was already back then.

A lot of the things that we were annoyed with 10 or 15 years ago have been solved too. Backups, replications, sharding, performances in some cases, advanced column types, and even full-text search have been greatly improved.

It costs zero to use locally for development purposes and is also low cost when you want to host it for small needs. It scales well to very large settings too. And in those cases, you can find plenty of IaaS providers with a nice hosted PostgreSQL service (with or without High Availability).
Several other services you can use either in replacement or alternatives once your project grows are PostgreSQL compatible: AWS Redshift and AWS Aurora for example, but also CockroachDB just to name a few.

PostgreSQL will serve you well for quite a long time. And, if you are starting to have too much data or complexity for it, you probably have enough money to pay experts in the domain to either tune your setup or design something else.

Nowadays I would not recommend going with MySQL. Although another darling of the OpenSource community, its strengths are not as big compared to the many benefits of relying on PostgreSQL.

So. If you need to rely on an SQL database you cannot go wrong with PostgreSQL in the very large majority of cases.