Compare
Side-by-side on the decisions that recur: index vs scan, normalize vs denormalize, optimistic vs pessimistic, partition vs shard, and more — with when to choose each.
Index Scan vs Sequential ScanNormalize vs DenormalizeOptimistic locking vs Pessimistic lockingRead Committed vs SerializablePartitioning vs ShardingRead replica vs ShardRelational vs DocumentPostgres + pgvector vs Dedicated vector DBCache-aside vs Write-throughB+ tree storage engine vs LSM tree storage engineHeap table + secondary indexes (PostgreSQL-style) vs Clustered primary index (InnoDB-style)LRU vs Clock (second chance)Synchronous replication vs Asynchronous replication
| Relational | Document | |
|---|---|---|
| Unit of work | Rows across normalised tables | One nested aggregate document |
| Joins | First-class | Weak ($lookup is a nested loop) |
| Transactions | Full, across tables | Per document; cross-document is newer and slower |
| Schema | Enforced | In your code (enable validation) |
| Shines when | Relationships, ad-hoc queries, invariants | The whole object is the read and write, with variable shape |
| Choose this when | Relationships matter, requirements will change, and you need joins and invariants — the default. | The natural unit is one aggregate read and written whole, with few cross-document queries. |