| Data Model | Tables with rows and columns. Fixed schema with constraints. Relationships via foreign keys. | Collections of JSON-like documents. Flexible schema. Embedded documents or references for relationships. |
| Query Language | SQL with full join support, window functions, CTEs, subqueries, and recursive queries. | MongoDB Query Language (MQL) with find, aggregate pipeline, and update operators. |
| Transactions | Full ACID transactions across any number of rows and tables. Serializable isolation level available. | Multi-document ACID transactions supported since v4.0 but with performance overhead. |
| Scalability | Vertical scaling primarily. Read replicas for read scaling. Citus extension for horizontal sharding. | Built-in horizontal sharding. Designed for distributed deployments across multiple nodes. |
| Schema Flexibility | Strict schema with migrations. JSONB columns offer document-like flexibility within a relational model. | Schema-less by default. Schema validation available but optional. No migration step needed. |
| Indexing | B-tree, Hash, GiST, SP-GiST, GIN, BRIN indexes. Partial and expression indexes. Excellent optimizer. | B-tree, compound, multikey, text, geospatial, and wildcard indexes. Atlas Search for full-text. |
| ORM/ODM Support | Prisma, Drizzle, TypeORM, Sequelize, and Knex provide excellent TypeScript/Node.js integration. | Mongoose is the dominant ODM for Node.js. Prisma also supports MongoDB with some limitations. |
| Hosting Options | Self-hosted, AWS RDS, Google Cloud SQL, Supabase, Neon (serverless), and many others. | MongoDB Atlas (managed), self-hosted, AWS DocumentDB (compatibility layer). |