PostgreSQL vs MySQL vs SQLite: how the big open-source databases differ
Three open-source relational databases power a huge share of the world's software. They all speak SQL, but they are built for different situations.
SQLite
- Embedded: the whole database is a library inside your app, and the data lives in a single file.
- No server to install, configure or connect to.
- Ships in phones, browsers, desktop apps and countless devices.
- Great for local storage, prototypes, small to medium websites, and read-heavy workloads.
- Concurrency is the main constraint: many readers are fine, but writes are serialized.
- Its source code is in the public domain.
MySQL
- Client-server database, long popular for web applications.
- Known for being straightforward to run and replicate.
- Owned by Oracle, licensed under the GPL with commercial options. MariaDB is a community fork created by original developers.
PostgreSQL
- Client-server database with a reputation for standards compliance, strong data integrity and extensibility.
- Rich features: advanced indexing, JSON support, window functions, custom types, and an extension ecosystem.
- Released under the permissive PostgreSQL License and developed by a community rather than one company.
Choosing in practice
- Single-user app, local data, or a small site: SQLite is often enough.
- A team with existing MySQL experience and tooling: MySQL or MariaDB is a solid choice.
- Complex queries, lots of data types, or heavy use of extensions: PostgreSQL is a common default.
Honestly, all three are mature. Familiarity, hosting options and your team's skills matter as much as features.
Over to you:
- Which database do you reach for by default, and why?
- Have you ever migrated between these? What was hardest?
Comments · 3
SQLite is great for learning because you don't have to install a server. Perfect for small apps and testing before moving to Postgres.
We started on SQLite and moved to Postgres once we needed concurrent writes. Easy to switch if you don't use database-specific features early.
When does MySQL win over Postgres? I'm guessing it depends on the tooling and hosting you're using.