Default answer: PostgreSQL, unless you have a reason not to. The reasons are what this page is about.
| PostgreSQL | MySQL / MariaDB | MongoDB | SQLite | |
|---|---|---|---|---|
| Model | Relational (+ JSONB) | Relational | Document (BSON) | Relational, embedded |
| Runs as | Server | Server | Server / Atlas | A file in your app |
| Strengths | Features, correctness, extensions (PostGIS, pgvector) | Ubiquitous, simple, fast reads, huge hosting support | Flexible schema, horizontal scaling, nested data | Zero setup, tiny, perfect for local/edge |
| Watch out for | Needs tuning (vacuum, connections) at scale | Fewer advanced features | Joins and multi-document transactions are costlier; schema discipline is on you | One writer at a time; not for many concurrent writers |
| .NET provider | Npgsql | Pomelo / MySqlConnector | MongoDB.Driver | Microsoft.Data.Sqlite |
// Same DbContext, different provider
options.UseNpgsql(connString); // PostgreSQL
options.UseMySql(connString, ServerVersion.AutoDetect(connString)); // MySQL (Pomelo)
options.UseSqlite("Data Source=app.db"); // SQLite