juniordatabases
SQL — structured data, ACID, joins. NoSQL — flexible schema, horizontal scaling, high write throughput.
SQL (PostgreSQL, MySQL): strict schema, ACID transactions, complex JOINs, mature tooling. NoSQL: Document (MongoDB) — flexible schema, Key-Value (Redis, DynamoDB) — simple lookups, Wide-Column (Cassandra) — time-series, Graph (Neo4j) — relationships. CAP theorem: SQL is typically CP, NoSQL is often AP.
When yes
SQL: finance, e-commerce, complex queries. NoSQL: social feeds, IoT, real-time analytics
When no
NoSQL for banking transactions. SQL for unstructured data
Interview tip
Don't say 'NoSQL is better' — explain the trade-offs for the specific use case
Alt:NewSQL (CockroachDB, Spanner)Polyglot persistence