Comparison

Database Comparison

Side-by-side comparison of PostgreSQL, MySQL, MongoDB, and DuckDB across data model, scalability, vector search, and operational characteristics.

FeaturePostgreSQLMySQLMongoDBDuckDB
Data ModelRelational (tables, rows, SQL)Relational (tables, rows, SQL)Document (BSON/JSON)Relational (columnar storage)
Query LanguageSQL (full standard compliance)SQL (partial standard compliance)MQL (MongoDB Query Language)SQL (PostgreSQL-compatible dialect)
ScalabilityVertical; horizontal via Citus extensionVertical; horizontal via Vitess or Group ReplicationHorizontal (native sharding)Single-node (in-process)
ACID ComplianceFull ACID with MVCCFull ACID with InnoDBMulti-document transactions (since 4.0)Full ACID
Vector SearchYes (pgvector with HNSW indexes)Limited (HeatWave, third-party)Yes (Atlas Vector Search)Via extensions (vss)
Best ForGeneral-purpose OLTP, AI/RAG applications, mixed workloadsWeb applications, CMS platforms, read-heavy workloadsContent management, catalogs, rapidly evolving schemasLocal analytics, data science, ETL, embedded OLAP
LicensePostgreSQL License (permissive)GPL v2 (dual-licensed by Oracle)SSPL (Server Side Public License)MIT
ReplicationStreaming + logical replicationAsync, semi-sync, Group ReplicationReplica sets with automatic failoverNone (single-process)
JSON SupportNative JSONB with indexingNative JSON type with functionsNative (documents are JSON/BSON)Native JSON with auto-schema detection
Operational ComplexityModerate. mature tooling and communityLow. well-understood operationsModerate. sharding adds complexityMinimal. no server to manage

Summary

PostgreSQL

The default choice for most applications. ACID-compliant, extensible, and now capable of vector search via pgvector.

MySQL

The most widely deployed open-source database, powering much of the web, with strong InnoDB transactional support.

MongoDB

The leading document database, optimized for flexible schemas and rapid iteration, with built-in vector search.

DuckDB

An in-process analytical database optimized for fast OLAP queries on local data, with zero operational overhead.