System Design Fundamentals
Back to Foundations and Building Blocks

SQL vs NoSQL

The most-asked DB question in interviews. Strengths, weaknesses, and concrete signals for choosing one over the other. FIND_VIDEO: search 'SQL vs NoSQL when to use which' — recommended channel: ByteByteGo / Hussein Nasser. Aim for 11 min or under.

4 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Foundational Database Definitions — Introduces relational table models and vertical scaling alongside non-relational document, key-value, and graph horizontal architectures.
  2. Strengths of Relational Databases — Details how relational schema design and ACID transaction guarantees protect structured data integrity.
  3. Limitations of Relational Databases — Analyzes the high setup overhead, schema rigidity, and costly horizontal scaling barriers of SQL databases.
  4. Advantages of NoSQL Databases — Examines schema flexibility, rapid prototyping, and horizontal sharding across cost-effective commodity servers.
  5. Consistency Tradeoffs in Distributed NoSQL — Explains how peer-to-peer replication achieves write scale while introducing eventual consistency across cluster nodes.
PDF notes

Frequently asked questions

Why is horizontal scaling difficult for relational databases?

Relational joins, constraints, and ACID transactions require synchronized cross-node coordination, introducing significant latency and distributed locking overhead.

What does eventual consistency mean in practice?

When data is updated on one node, replicas temporarily serve stale data until the update propagates across the distributed cluster.

Can NoSQL databases store structured data?

Yes, NoSQL handles structured, semi-structured, and unstructured data, but it does not enforce relational integrity constraints out of the box.

When should I choose SQL over NoSQL in an interview?

Choose SQL when you need ACID guarantees, multi-entity relationships, strict schemas, or when vertical scaling meets the system's write volume.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.