SDE & MLE Prep

SQL vs NoSQL

Relational (Postgres, MySQL)NoSQL
Modeltables, joins, schemakey-value (Redis, DynamoDB), document (Mongo), wide-column (Cassandra, Bigtable), graph (Neo4j)
TransactionsACID, multi-rowusually single-key/partition; some offer more
Scalingvertical + read replicas; sharding is manualbuilt-in partitioning, horizontal
Best formoney, inventory, relationships, ad-hoc querieshuge scale, simple access patterns, flexible schema, high write throughput

Rule of thumb: start relational unless you have a clear reason (massive write volume, simple key access, schema flexibility, time-series). Model NoSQL tables around queries, not entities.