The Best Database for Your Web Development Project
A web app keeps everything it knows in a database: your customers, their orders, bookings, messages and payments. The database is chosen in the first days of a project, and it is one of the hardest choices to change later, because the rest of the app is written to work with it. For most new projects the right choice is PostgreSQL.
The short answer
- For a new web app, PostgreSQL.
- For a WordPress site or a WooCommerce store, MySQL or MariaDB, because WordPress runs on those two.
- For a small site on one server, or for data kept on a phone, SQLite.
- For records that don’t share a shape, MongoDB.
- For a business that already runs on Microsoft’s tools, SQL Server.
All five are in wide use. They differ in what each is built for, what it costs to run and how easy it is to find people who know it.
Two kinds of database
Most business data is connected. A customer has orders, an order has items, and each item is a product with a price. A relational database, also called an SQL database after the language used to question it, keeps each of these in its own table and links the tables. It also enforces the rules you give it, so it refuses to save an order that belongs to no customer. PostgreSQL, MySQL, MariaDB, SQLite and SQL Server are all relational.
A document database keeps each record as one document, in a format called JSON, and two documents in the same collection can hold different fields. MongoDB is the best known. It suits data with no fixed shape, and it leaves more of the checking to the app’s own code.
PostgreSQL for most new projects
PostgreSQL is free and open source, and no company owns it. The PostgreSQL Global Development Group releases a new version about once a year and supports each one for five years. The latest, PostgreSQL 19, came out on November 19, 2026.
The large cloud providers each offer it as a managed service, which means the provider runs the server, applies the updates and takes the backups. Because so many hosts run the same database, you can move from one host to another without rewriting your app.
It also does work that used to need a second database. It stores JSON documents beside ordinary tables and searches text, and with extensions it handles map data (PostGIS) and the vector search that AI features use (pgvector).
More developers work with PostgreSQL than with any other database. In Stack Overflow’s 2026 Developer Survey, 57.9% of the 12,061 developers who answered the question had done extensive work with PostgreSQL in the past year. SQLite came second at 42.1% and MySQL third at 35.1%. For you that means it is easier to hire for, and easier to hand over to another team.
PostgreSQL is a server that someone has to set up and look after, or that you pay a host to run. For a site of a few pages with a contact form, that is more than you need.
MySQL and MariaDB for WordPress
WordPress keeps its pages, posts and settings in MySQL or MariaDB, and its requirements name no other database. If your site runs on WordPress, or your store on WooCommerce, the choice is made, and it is a sound one. Both are relational and almost every web host offers them.
MySQL belongs to Oracle. MariaDB began as a copy of MySQL made by MySQL’s original developers, and WordPress works with either.
Check which version your site runs. According to Oracle’s release notes, MySQL 8.0 reached the end of its life in April 2026, and the version to move to is MySQL 8.4. WordPress recommends MySQL 8.4 or MariaDB 10.11, or newer. Your host can tell you which one you have.
SQLite for small sites and for phones
SQLite is a database in a single file. There is no server to run and nothing to pay, and it is built into every iPhone and Android phone, where apps use it to keep data on the device.
On the web it suits a site that lives on one server. SQLite’s own guide says it works well for most websites with low to medium traffic. Only one change can be written at a time, so an app with many people saving at once, or one that runs on several servers, needs one of the others.
MongoDB for records that don’t share a shape
MongoDB fits when the data is naturally a set of documents: a product catalog where a shirt and a laptop have different fields, content with parts nested inside parts, or readings sent in by devices.
It has supported transactions across several documents since 2018. A transaction makes a group of changes succeed or fail together, which is what an order or a payment needs. The article we published here in 2016 said MongoDB couldn’t be used for that work, and that is no longer true.
PostgreSQL stores JSON documents too, so a few fields that vary are no reason to choose MongoDB. Choose it when most of your data is documents and your developers know it well.
SQL Server for businesses on Microsoft’s tools
Microsoft SQL Server is a relational database with a paid license, and since its 2017 version it runs on Linux as well as Windows. Choose it when the app has to work closely with other Microsoft products the business already pays for, or when your developers write in Microsoft’s .NET.
Its free edition, Express, holds up to 50 GB in a database as of SQL Server 2025. Without a reason like those above, the license is a cost that PostgreSQL and MySQL don’t have.
Hosted services built on a database
Services such as Supabase and Google’s Firebase add sign-in, file storage and live updates to a database, which shortens the work on a first version. Look at what is underneath before you choose one.
Supabase is PostgreSQL, so your data can move to any PostgreSQL host later. Firebase’s Cloud Firestore is Google’s own document database, and Google bills it by the number of reads and writes. The cost follows how busy the app is, and moving away means rewriting the parts of the app that talk to it.
One database to start with
Large products often run several: a main database, a cache such as Redis that keeps frequent answers in memory, and a search engine. Each one is another thing to host, back up and keep in step with the rest. Start with one, and add a second when you can measure the problem it solves.
Six questions to ask before you agree to a database
- Whose account is it in? The database should run in an account your business owns, with the developers given access to it.
- How is it backed up? Ask how often, how long the backups are kept and when someone last restored one as a test.
- Can you take the data with you? Ask for a full export in a standard format, such as an SQL file.
- Which version is it, and when does support for that version end?
- What does it cost each month now, and what would it cost with ten times the data?
- Where is the data kept, and is it encrypted? If you take card payments or keep health records, say so before the database is chosen, because the rules for that data affect how and where it can be kept.
A MySQL database that is backed up and kept up to date is a better place for your data than a PostgreSQL database that nobody looks after.
If you aren’t sure which one fits
Tell us what you’re building and what you already have. Choosing the database is part of our web app development and consulting work, and if a simpler option does the job, we say so. You can get a free quote within one business day.
This article replaces the one we published at this address in May 2016. Versions, limits and survey figures are from November 22, 2026, so check each database’s own site before you decide.