Last Minute Notes
  • Github
  • Docs
  • Learn
    @sayanstwt
Lessons
0/37 done
  • SQL vs NoSQL
  • Indexes & Storage Engines
  • Replication
  • Sharding
  • Consistent Hashing
  • Object Storage & Uploads
  • Search & Inverted Indexes
Learn/System Design/Data & Storage

SQL vs NoSQL

7 min Beginner 7 steps

Pick a data store from the access pattern, not the hype.

Schema
fixed
Joins
native
Transactions
full ACID
App serverPostgreSQLone primaryusersorderspaymentsmulti-row ACIDBEGIN tx
request response data
In this lessonStep 1 of 7
  1. The problem
  2. SQL vs NoSQL
  3. Families
  4. Distributed SQL
  5. Polyglot
  6. IDs
  7. Recap
Step 1 / 7problem

Start relational, leave for a reason

A relational database gives you a fixed schema, native joins and multi-row ACID transactions. Most apps start here.

The question is not "SQL or NoSQL?" but "which requirement forces me off one primary?"

Key idea

Start with a relational database. Move away only when a requirement forces you to.

←→ step·R replay·Space pause

You'll learn

  • Why the default is a relational database
  • How SQL and NoSQL differ on schema, joins, transactions and scaling
  • Match each NoSQL family to its access pattern
  • Keep one source of truth and derive the rest
  • Pick an id scheme that suits B-tree inserts
Read the full notesHLD Building Blocks, 7