ReviseAlgo Logo
Intermediate10 min readData Storage & Databases

SQL vs NoSQL

Contrasting structured relational storage against highly elastic, denormalized non-relational engines.

What you'll learn

  • SQL (Relational)
  • NoSQL (Non-relational)
  • ACID
  • BASE

TL;DR

Contrasting structured relational storage against highly elastic, denormalized non-relational engines.

Visual System Topology

SQL vs NoSQL Structure

SQL (Relational)

Table: USERS
id name
1 Alice
Table: ADDRESSES
id user_id city
101 1 New York
Strict Schema & Normalized (Uses JOINs)

NoSQL (Document)

Collection: USERS
{
"_id": "1",
"name": "Alice",
"address": {
"city": "New York"
}
}
Flexible Schema & Denormalized (Nested Data)

Concept Overview

SQL (Structured Query Language) databases store data in structured tables with predefined schemas, while NoSQL databases use flexible data models like documents, key-value pairs, or graphs.

The choice between SQL and NoSQL depends on your data structure, consistency requirements, and scaling needs.

Key Architectural Pillars

1

SQL (Relational)

Data in tables with rows and columns. Fixed schema. Relationships via foreign keys. ACID transactions. Examples: PostgreSQL, MySQL, Oracle.

2

NoSQL (Non-relational)

Flexible schema. Multiple data models: Document (MongoDB), Key-Value (Redis), Column (Cassandra), Graph (Neo4j). BASE properties.

3

ACID

Atomicity, Consistency, Isolation, Durability. Guarantees for SQL transactions ensuring data integrity.

4

BASE

Basically Available, Soft state, Eventually consistent. NoSQL trade-off: availability over immediate consistency.

AI Tutor

Ask about the topic

Sign in Required

Please sign in to use the AI tutor

Sign In
SQL vs NoSQL - Module 3: Data Storage & Databases | System Design | Revise Algo