SQL vs NoSQL Databases

Context: FIT1043_MOC · choosing a store for a data project · the relational world vs the NoSQL world · driven by the V’s

Quick Revision

  • 🎯 Objective: pick SQL vs NoSQL by the data’s shape and change rate ➔ structured+stable → SQL; large/unstructured/fast-changing → NoSQL.
  • 📦 Core Components: SQL = relational + schema + ACID | NoSQL = non-relational + dynamic schema + horizontal scale.
  • ⚡ Key Constraint: the deciding factors are schema rigidity and scaling direction — vertical (SQL) vs horizontal (NoSQL).

📝 How It Works

1. The Landscape

  • RDBMS ➔ SQL-based; stores/manages/queries a relational database; ACID, transaction-oriented (like indexed spreadsheets).
  • NoSQL ➔ typically JSON storage; graph models.
  • Graph DB ➔ stores triples (subject–verb–object); RDF/SPARQL; common for Linked Open Data.

2. The Five Differences

  • Relational vs not ➔ SQL relational; NoSQL non-relational.
  • Schema ➔ SQL predefined/fixed; NoSQL dynamic (for unstructured data).
  • Scaling ➔ SQL vertical (scale up); NoSQL horizontal (scale out).
  • Model ➔ SQL table-based; NoSQL document / key-value / graph / wide-column.
  • Best for ➔ SQL multi-row transactions; NoSQL unstructured data (documents/JSON).

3. Suitability & Shared Traits

  • Use SQL ➔ data is structured and unchanging.
  • Use NoSQLlarge volume, little/no structure, or rapidly changing data (the V’s).
  • Both offer ➔ large-scale distributed processing, robustness, general query languages, and some consistency (often “eventual” as nodes propagate updates).
  • Polyglot persistence ➔ “NoSQL” = Not only SQL; systems may sit alongside SQL and support SQL-like queries.

⚖️ Core Decision Matrix

AspectSQL (RDBMS)NoSQL
Relational?yesno
Schemapredefined/fixeddynamic
Scalingvertical (up)horizontal (out)
Modeltablesdocument / key-value / graph / wide-column
Best formulti-row transactionsunstructured / JSON, fast change

When It Flips: the split traces back to the V's — a fixed schema serves structured, stable data (SQL); dynamic schemas + horizontal scaling serve high-Volume/Velocity/Variety data (NoSQL).

🧠 Active Recall