Core Concept

SQL vs NoSQL Databases

Databases dictate system limits: pick Relational (SQL) when you need strict transactional ACID guarantees; select Non-Relational (NoSQL) when you need flexible models or horizontal scale.


What:

Structured Relational databases (PostgreSQL, MySQL) mapping strict tables vs unstructured/semi-structured Non-Relational stores (Cassandra, DynamoDB, MongoDB).

Primary purpose:

Selecting the optimal data persistence paradigm based on transaction safety requirements, scalability limits, and query dynamics.

Usually used for:

Transactional records, distributed session storage, real-time message streams, and heavy full-text search indexes.

How should I think about this inside system architectures?

💍 Relational Normalization

Eliminate duplication. Normalize records into distinct primary tables and join them on-the-fly using foreign key references.

🌾 Denormalized Wide-Column

Duplicate data aggressively. In NoSQL (Cassandra), write your schemas exactly to match your read query patterns (one table per query).

🏗️ Polyglot Persistence

Never select 'one DB for everything'. Deploy PostgreSQL for financials, Redis for sessions, and Cassandra for telemetry history.