Skip to content
App development

PostgreSQL, MySQL or NoSQL? How to choose a database you won’t have to replace in three years

Choosing a database is one of those decisions that takes an afternoon at the start of a project and then stays with you for years. Switching databases under a live application is a major project, as the Guardian, Uber and Discord all found out. We compared PostgreSQL, MySQL and the best-known NoSQL databases using current survey data, price lists and documentation as of September 29, 2026. We also cover where your data physically lives and what the GDPR requires.

Cover: 55.6% of developers worked with PostgreSQL in 2025, 24.01% of EU companies with 10+ staff pay for cloud database hosting, each major PostgreSQL version gets 5 years of support

When your developer says “we’ll use Postgres,” they’re usually right. Not always, though. A WordPress site runs cheapest on the MySQL or MariaDB that comes with your hosting plan. A chat app storing billions of messages needs a different kind of database than an invoicing system. And a cache that makes pages load fast is a separate question altogether.

We start with a short answer in one table, then compare the three main options and their prices, and finish with five questions to answer before you sign off on a spec. We explain the technical terms so that a business owner who doesn’t write code can make the call.

01The short answer: which database is best for which project

ProjectSensible choiceWhy
Company website or WordPress storeMySQL or MariaDBIncluded with standard hosting, and WordPress is built around it.
Custom app: orders, invoices, users, inventoryPostgreSQLTransactions and relationships like any relational database, plus indexed JSONB and an AI extension.
Fast cache, job queues, user sessionsRedis or Valkey next to your main databaseKeeps data in memory and responds very quickly. Not suitable as your only database.
Catalog with a changing structure, metadata, logsMongoDB, or PostgreSQL with JSONBDocuments without a fixed schema. PostgreSQL handles this too unless volumes are huge.
Billions of messages or events with simple queriesCassandra, ScyllaDB, DynamoDBBuilt to spread data across dozens of servers. Overkill for a typical business app.
Search by meaning for an AI assistantPostgreSQL with pgvectorVectors sit next to the rest of your data. Look at a dedicated database only at large volumes.
General guidance for typical business projects. The right choice depends on your data, your team and your budget.

If the table doesn’t give you a clear answer, go with PostgreSQL. It’s the safest default: it handles relational data and documents, it has a permissive license, and every major cloud offers it as a managed service. Move to NoSQL once you have a specific reason to.

02SQL vs NoSQL: relational and non-relational databases without the jargon

A relational database (PostgreSQL, MySQL, MariaDB, Microsoft SQL Server, Oracle) stores data in tables with fixed columns. Customers live in one table, their orders in another, and the database makes sure no order belongs to a customer who doesn’t exist. You query it in SQL. When you move money between two accounts, a relational database guarantees that either the whole transfer happens or none of it does. That’s called a transaction.

NoSQL is an umbrella term for databases that don’t use tables, or don’t use them as their main model. The most common types:

  • Document (MongoDB): each record is a JSON-like document, so two products in a catalog can have completely different fields.
  • Key-value (Redis, Valkey, DynamoDB): the simplest model, where you look up a value by its key. Typically a cache or user sessions.
  • Wide-column (Cassandra, ScyllaDB): designed for huge write volumes spread across many servers.
  • Graph (Neo4j): the relationships between records are the main content, as in a social network or a recommendation engine.

Over the past decade the line between the two has blurred. Since version 9.4 in 2014, PostgreSQL has had a JSONB type that stores and indexes documents much like MongoDB does. At the time, the PostgreSQL team wrote that users “no longer have to choose between relational and non-relational data stores” (PostgreSQL). MongoDB, for its part, has supported multi-document transactions since version 4.0 in 2018 (MongoDB).

Timeline 2014 to 2025: JSONB in PostgreSQL 9.4, JSON in MySQL 5.7.8, schema validation in MongoDB 3.2, transactions in MongoDB 4.0, pgvector, the HNSW index and PostgreSQL 18
How relational and NoSQL databases converged over a decade.

03What developers use, and why it matters

A database that lots of developers know has a practical advantage for your business: it’s easier to hire someone to run it, and most problems already have a documented fix. The largest public developer survey is run by Stack Overflow. In the 2025 edition, 26,083 people answered the database question (Stack Overflow).

Databases used for extensive development work (2025)
  • PostgreSQL55.6%
  • MySQL40.5%
  • SQLite37.5%
  • Microsoft SQL Server30.1%
  • Redis28.0%
  • MongoDB24.0%
  • MariaDB22.5%
  • Elasticsearch16.7%
  • Oracle10.6%
  • DynamoDB9.8%

Share of all 26,083 respondents who answered the question; respondents could pick more than one database. Source: Stack Overflow Developer Survey 2025.

PostgreSQL also leads on what developers want to keep using: 65.5% of those who work with it want to continue, and 46.5% of all respondents want to work with it next year. Stack Overflow says it has ranked first on both measures every year since 2023.

Back in 2018, 59% of developers used MySQL and 33% used PostgreSQL. PostgreSQL narrowly overtook MySQL among professional developers in 2022, and among all respondents a year later (Stack Overflow 2022, 2023).

PostgreSQL and MySQL in the Stack Overflow survey
  • 2018MySQL: 59.0%PostgreSQL: 33.0%
  • 2022MySQL: 46.9%PostgreSQL: 43.6%
  • 2023MySQL: 41.1%PostgreSQL: 45.6%
  • 2024MySQL: 40.3%PostgreSQL: 48.7%
  • 2025MySQL: 40.5%PostgreSQL: 55.6%

All respondents. The 2018 figures are quoted in the 2024 edition. In 2025 Stack Overflow changed how some questions are calculated and fewer people answered, so treat the jump from 2024 to 2025 as indicative (2025 methodology).

The DB-Engines ranking tells a different story. In September 2026 Oracle leads with 1,122 points, followed by MySQL (845), Microsoft SQL Server (699) and PostgreSQL in fourth (683). MongoDB, at 381 points, is the highest-ranked NoSQL database (DB-Engines). But the ranking counts, among other things, web mentions, search interest, Stack Overflow questions, job ads and LinkedIn profiles. DB-Engines itself says it “does not measure the number of installations” (DB-Engines methodology). Over the past five years MySQL has lost about 30% of its score there, while PostgreSQL has gained 18%.

The one safe conclusion from both sources: PostgreSQL and MySQL are both used at massive scale, and you won’t struggle to find people who know them. “PostgreSQL is the world’s most popular database” holds only for the Stack Overflow survey.

04PostgreSQL: the default for custom applications

PostgreSQL is an open source database with nearly 30 years of development behind it. It’s released under the PostgreSQL License, which is similar to the BSD and MIT licenses: you can use, modify and distribute it without fees or a written agreement (PostgreSQL). No single company owns it, so nobody can change its license or start charging for the database itself.

Strengths

  • Reliable transactions and relationships between records. Essential for accounting, orders and inventory.
  • JSONB. Store documents with a changing structure alongside regular tables, and index them.
  • Extensions. Add capabilities such as vector search for AI (pgvector).
  • Predictable support. Each major version gets fixes for 5 years, and a new one ships roughly once a year (PostgreSQL).

The current release is PostgreSQL 18 from September 2025, supported until November 2030. It added a new asynchronous I/O subsystem that, according to the developers, made reads from storage up to three times faster in some scenarios (PostgreSQL 18). As of September 29, 2026, version 19 is in its fourth beta. Watch out for version 14: it stops receiving fixes on November 12, 2026.

How far PostgreSQL scales

A common worry is that a relational database “won’t cope” with heavy traffic. Large companies show otherwise. Notion ran on a single PostgreSQL database for five years and four orders of magnitude of growth before splitting it into 480 logical shards across 32 physical databases (Notion). In 2020 Figma ran a single PostgreSQL database on the largest instance AWS offered, and its database stack has grown almost 100 times since. Figma considered NoSQL and rejected it because NoSQL APIs don’t offer enough flexibility for its complex relational data model (Figma). According to InfoQ, OpenAI serves 800 million ChatGPT users from a single primary PostgreSQL instance with nearly 50 read replicas, although new write-heavy workloads now go to sharded systems such as Azure Cosmos DB (InfoQ).

We cover how to prepare a database for growth, from indexes to replicas, in Web app scalability.

Weaker spots

PostgreSQL needs a bit more tuning than MySQL: connection pooling, regular cleanup of old row versions (VACUUM) and planned major-version upgrades. It’s less common on cheap shared hosting, and when it is available, it’s often an older version. With a managed cloud service, most of this is taken care of.

05MySQL and MariaDB: the safe bet on cheap hosting

MySQL is owned by Oracle and offered under two licenses: free under GPLv2, or a paid commercial license. The commercial license is mainly for companies that ship MySQL with their own software and don’t want to release that software’s source code under the GPL (MySQL). For a typical web application running on a server, it doesn’t apply. MariaDB is a community fork of MySQL and, for most applications, a drop-in alternative.

The biggest advantage of MySQL and MariaDB is availability. WordPress recommends MariaDB 10.11 or later, or MySQL 8.0 or later (WordPress), and shared hosting plans typically include one of them. PostgreSQL is less common. In the Czech Republic and Slovakia, for example, Websupport and Active24 offer PostgreSQL 14 on shared hosting, while VEDOS (formerly WEDOS) only offers MariaDB (Websupport, VEDOS).

If you’re going with MySQL, note how its versioning has changed. Version 8.0 no longer has premier or extended support from Oracle; that ended in April 2026. The current long-term support (LTS) lines are 8.4 and 9.7, with extended support until 2032 and 2034 respectively (Oracle). Since July 2026, Oracle has used calendar versioning, starting with MySQL 26.7.0 (MySQL). Guides that call the 9.x series the latest are out of date.

MySQL handles heavy traffic too. In 2016 Uber explained why, in many places where it had used PostgreSQL, it switched to Schemaless, its own sharding layer built on MySQL. The reasons included write efficiency, replication and difficult upgrades in the PostgreSQL of the time (Uber). The post is ten years old, and many major PostgreSQL versions have shipped since. That makes it a weak argument against today’s PostgreSQL, but it does show that MySQL can handle heavy traffic.

06NoSQL: when MongoDB, Redis and friends make sense

NoSQL databases are specialized tools. They work best when their data model matches the job exactly.

MongoDB

A document database with a flexible schema, popular for building prototypes quickly. The old objection that it has no transactions hasn’t been true since 2018. MongoDB’s own documentation points out that an operation on a single document is atomic, and that with good data modeling many common use cases don’t need multi-document transactions at all (MongoDB). Version 9.0 was released on September 28, 2026 (MongoDB).

Czech company Apify stores metadata about its users and their jobs in MongoDB and keeps the actual data in separate stores (Apify 2021). According to its engineering blog, its main 1.5 TB, 32 vCPU cluster ran into performance bottlenecks, and the company planned to shard it (Apify).

The Guardian went the other way. In 2018 it moved roughly 2.3 million content items from MongoDB to PostgreSQL on AWS. Running its own MongoDB cluster had cost at least two months of engineering time a year, and two outages had each stopped publishing for an hour or more. PostgreSQL’s JSONB type let the team migrate with minimal changes to its data model (Guardian).

Redis and Valkey

In-memory databases that respond very quickly. They’re used for caching, job queues, counters and user sessions, always alongside a main database. In March 2024 Redis dropped its open source BSD license (Redis), which led to Valkey, a fork under the Linux Foundation backed by AWS and Google Cloud among others (Linux Foundation). Since version 8 in May 2025, Redis has again been available under an open source license, AGPLv3, as one of three license options (Redis).

Cassandra, ScyllaDB and DynamoDB

Cassandra and ScyllaDB pay off only at truly massive scale. DynamoDB is also used for smaller serverless apps on AWS, but it suits only simple data access patterns. Discord started in 2015 on a single MongoDB replica set. At 100 million stored messages, the data and indexes no longer fit in memory and latency became unpredictable, so it moved to Cassandra (Discord 2017). By early 2022 it ran 177 Cassandra nodes holding trillions of messages, and it moved them to 72 ScyllaDB nodes. The p99 latency for fetching older messages fell from between 40 and 125 ms to 15 ms (Discord 2023).

There’s a lesson here for smaller companies: MongoDB was a good choice for a fast start, and the switch came only once the product had grown. Don’t design a database for billions of records when your business app has a few hundred users.

07Licensing: who controls the terms of your database

When your whole business runs on a database, it’s worth knowing who controls its license. Two of the best-known NoSQL databases have changed theirs in the past eight years.

DatabaseLicense todayWhat it means for you
PostgreSQLPostgreSQL License, permissive open sourceFree to use without restrictions; no single company owns the project.
MySQLGPLv2 or Oracle commercial licenseFree for a web app on your own server. The paid license mainly matters if you bundle MySQL into your product.
MariaDBGPLv2Community-driven, with a new long-term release every year.
MongoDBSSPL since Oct 16, 2018No fee to use it in your own application. The Open Source Initiative, however, doesn’t consider the SSPL an open source license (OSI).
RedisRSALv2, SSPLv1 or AGPLv3 (from version 8)The license changed in 2024 and again in 2025. Valkey, under the BSD license, is the alternative.
This isn’t legal advice. If you modify the database or offer it as a service to third parties, have a lawyer review the license.

08Databases for AI: vectors and semantic search

If you want an AI assistant to answer questions from your own documents, the text is turned into vectors and searched by similarity of meaning. You don’t need a new database to get started.

  • PostgreSQL with pgvector. An open source extension that stores vectors next to your other data. It has supported the fast HNSW index since version 0.5.0 in August 2023, and indexes vectors with up to 2,000 dimensions (pgvector).
  • MongoDB Atlas Vector Search. Vector search built into MongoDB, including approximate search with the HNSW algorithm (MongoDB).
  • MySQL. It has a VECTOR type, but Oracle only offers the function that computes the distance between vectors in the HeatWave cloud service and MySQL AI. It’s not in the Community edition (MySQL).

Consider a dedicated vector database once pgvector’s performance stops being enough, typically with a very large number of vectors or strict latency requirements. Until then, one database for all your data is simpler to back up and secure.

09What running a database costs

The database software itself is free. You pay for the server it runs on and for the time of the people who look after it. A managed cloud database (DBaaS) handles backups, updates and failover for you. In September 2026, entry prices start at around $14 a month:

Managed cloud database: monthly price (USD, excl. tax)
  • AWS RDS PostgreSQL, db.t4g.micro$14
  • Azure PostgreSQL, B1ms$15
  • DigitalOcean PostgreSQL, 1 GB RAM$15
  • Supabase Pro$25
  • MongoDB Atlas M10$57
  • AWS RDS PostgreSQL, db.m7g.large$146
  • Same with a standby replica (Multi-AZ)$293

Price lists as of Sep 29, 2026. AWS and Azure in the Frankfurt region, 730 hours, excluding storage and data transfer. DigitalOcean, Supabase and MongoDB Atlas include base storage and don’t specify a region; Atlas prices can vary by region. Sources: AWS, Azure, DigitalOcean, Supabase, MongoDB.

The cheapest instances, such as db.t4g.micro or B1ms, run on CPU credits and suit testing or small internal tools. For a production app with paying customers, plan on a machine with 2 vCPUs and 8 GB of memory (db.m7g.large, about $146) plus a standby replica in another availability zone, which doubles the price. Storage and backups come on top.

For the very beginning, free tiers are enough. Neon offers free PostgreSQL with 0.5 GB of storage per project (Neon), Supabase 500 MB with projects paused after a week of inactivity (Supabase), and MongoDB Atlas 512 MB (MongoDB). Fine for validating an idea. For production with customer data, move to a paid plan.

Kiwi.com shows how much work database administration takes. In 2022 it ran around 200 databases and said that moving PostgreSQL from AWS managed databases to Google’s Cloud SQL, with its built-in automation, saved work equivalent to ten additional database administrators. Note that the piece was published on the Google Cloud blog, the vendor’s own channel (Google Cloud). For planning running costs from day one, see How to plan SaaS development.

10Where your data lives, and what the GDPR says

According to Eurostat, 24.01% of EU companies with ten or more employees paid for cloud database hosting in 2025, up from 18.69% in 2021. The spread between countries is wide:

Companies paying for cloud database hosting (2025)
  • Denmark55.5%
  • Netherlands55.4%
  • Finland49.9%
  • Sweden44.3%
  • Hungary26.0%
  • EU average24.0%
  • Czech Republic22.8%
  • Germany21.4%
  • Austria17.8%
  • Slovakia16.0%
  • Poland8.8%

Share of companies with 10 or more employees, excluding the financial sector. Poland is an outlier: few companies report database hosting, but many pay for cloud development platforms. Source: Eurostat, isoc_cicce_use, indicator E_CC_PDB.

If your users are in Central Europe, note that none of the big three clouds has a region in the Czech Republic or Slovakia where your database could run. The nearest are Frankfurt (AWS, Azure, Google), Vienna (Azure Austria East), Warsaw (Google, Azure) and Berlin (Google) (AWS, Azure, Google Cloud).

The GDPR doesn’t require personal data to stay in a particular EU country. Transfers outside the EU are allowed only under the conditions it sets out. Since July 10, 2023, data can be transferred to US companies certified under the EU-US Data Privacy Framework without additional safeguards (European Commission). The EU General Court dismissed a challenge to the framework on September 3, 2025 (Court of Justice of the EU), but according to available reports the claimant has appealed to the Court of Justice (Digital Policy Alert). For sensitive or business-critical data, an EU region backed by a data processing agreement is the safer choice.

The GDPR doesn’t explicitly mandate database encryption. Article 32 lists it as an example of an appropriate measure, alongside the ability to restore data in a timely manner (GDPR, Article 32). With a managed cloud database, encryption and automated backups are usually just a setting. We cover security in more depth in Data security in custom software.

11Five questions to answer before you choose

Five questions before choosing a database: how your data is related, how much data you expect, who will run the database, where the data should live and how you would move away if needed
Put the answers to these questions in your spec before development starts.
  1. How is your data related? Customers, orders and invoices with firm links between them point to a relational database. Standalone documents with a changing structure can go into a document database.
  2. How much data and how many writes do you expect in three years? Most business apps fit on one database server with a replica. Distributed databases like Cassandra start to make sense at billions of records.
  3. Who will run the database? If you don’t have your own administrator, pay for a managed service. The provider is then responsible for backups, updates and recovery.
  4. Where should the data live? An EU region, encryption, backups and how long they’re kept all belong in your contract with the vendor.
  5. How would you move away? An open license and standard SQL make it easier to switch providers. Proprietary cloud databases tie you more closely to one vendor.

It pays to have these answers ready during the initial analysis. You can see how a project runs from spec to launch on our How it works page.

12Common mistakes when choosing a database

  • Following the hype. Pick MongoDB “for scalability” in an app where all the data is interconnected, and you’ll end up enforcing relationships by hand in application code.
  • Two primary databases from day one. Every extra database means extra backups, security and updates. Add a second one when you have a concrete reason.
  • An old version on your host. PostgreSQL 14 reaches end of life on November 12, 2026, and MySQL 8.0 is already past Oracle’s premier and extended support. Find out when and how your host upgrades.
  • A backup nobody has tried to restore. Test a restore at least once before launch, then regularly.
  • Planning sharding for ten users. Sharding its PostgreSQL took Figma nine months. Long before you need it, you’ll have worked through indexes, replicas and caching.

If your data still lives in spreadsheets and you’re wondering when to switch to a proper system, read When you’ve outgrown Excel. If you’re planning to move an existing app to the cloud, Cloud migration without downtime picks up where this article leaves off.

13FAQ

PostgreSQL vs MySQL: which is better?

For a custom app with orders, invoices or inventory, we recommend PostgreSQL: richer data types, JSONB, an AI extension and a permissive license. For a WordPress site or cheap shared hosting, MySQL or MariaDB is more practical because it comes with the plan. For typical projects, their performance is comparable.

MongoDB vs PostgreSQL: which should I pick?

If your data is interconnected (customers, orders, invoices), choose PostgreSQL. Its JSONB type stores documents with a changing structure, so it often covers what people pick MongoDB for. MongoDB makes sense when your whole data model consists of standalone documents and your team knows it well. The Guardian moved from MongoDB to PostgreSQL in 2018 thanks to JSONB, while Discord used MongoDB to build its first version quickly.

When is a NoSQL database worth it?

When its data model fits the job exactly: Redis or Valkey as a cache, MongoDB for documents with a changing structure, Cassandra or ScyllaDB for billions of messages or events. As the only database behind a typical business app, NoSQL is rarely the right fit.

Does MongoDB support transactions?

Yes. It has supported multi-document transactions since version 4.0 in 2018, and on sharded clusters since version 4.2 (MongoDB).

How much does a managed cloud database cost?

In September 2026 the smallest instances start at around $14 a month before tax. A production database with 2 vCPUs and 8 GB of memory on AWS costs about $146, or about $293 with a standby replica in a second availability zone, excluding storage and data transfer.

Does a database with personal data have to stay in the EU?

Not necessarily. The GDPR allows transfers outside the EU under specific conditions, for example to US companies certified under the EU-US Data Privacy Framework. For sensitive or business-critical data, we recommend an EU region with encryption and backups set out in the contract.

Can you switch databases later?

Yes, but it’s expensive. Discord built its own migration tool to move data from Cassandra to ScyllaDB, which cut the estimate from three months to nine days. Sharding PostgreSQL across servers took Figma nine months. Moving between PostgreSQL and MySQL is easier than moving between relational and NoSQL.

14Sources

Prices, versions and figures are as of September 29, 2026.

LISTIFY teamWebsites, apps and marketing from Prague since 2008

More articles

All articles →
App developmentSeptember 29, 2026 · 24 min read

App Notifications and Emails That Don’t Annoy: How to Set Them Up So the Important Ones Still Get Through

App developmentSeptember 28, 2026 · 20 min read

How to Stop Users From Deleting Your App After a Week: Push Notifications and Retention That Work

App developmentSeptember 28, 2026 · 26 min read

Web app scalability: how to prepare your system for hundreds of thousands of users

Share this page

By email

Got an idea?

On a short call, we'll find out what you need and suggest the next step. Then you'll get a proposal with a fixed price and a timeline.

+420 771 166 199Mon to Fri, 8:30 a.m. to 4:00 p.m. (Prague time) · info@listify.cool

When should we call you?

Pick a day and a time window. We'll call you, and it takes about 15 minutes.

Day