SQL vs NoSQL

Lesson · Junior

Picking the right data model.

Relational (SQL)

Tables, rows, a fixed schema, joins and ACID transactions. Great when data is structured and relationships and correctness matter (payments, inventory). Examples: PostgreSQL, MySQL.

NoSQL families

• Key-value: Redis, DynamoDB (fast lookups).

• Document: MongoDB (flexible JSON).

• Wide-column: Cassandra (huge write volume).

• Graph: Neo4j (relationship-heavy queries).

Typically trade joins and strict transactions for easier horizontal scaling and flexible schemas.

How to choose

Start from access patterns. Need transactions and ad-hoc queries? SQL. Massive scale, simple lookups, flexible shape? NoSQL. Many systems use both (polyglot persistence).