ELI5 · Databases & storage

SQL vs NoSQL.

Labelled filing cabinets with strict folders, versus a fast drawer you can toss anything into.

Both are ways to store data, but they make a different bargain about structure. SQL databases insist you define the shape up front and then keep everything tidy. NoSQL databases let you store first and stay flexible.

Neither is "better" — they fit different problems, and plenty of real systems use both.

  1. SCHEMA FIRST
    1

    SQL is a labelled filing cabinet: you define the folders — the schema — before storing anything.

  2. Wrong shape — rejected.
    expects □
    2

    Every record must fit the agreed shape, so the cabinet can enforce rules and reject mess.

  3. orders users join
    3

    Its real power is relationships: separate folders stitched together on demand with a join.

  4. Just toss it in.
    any shape, store first
    4

    NoSQL is a fast drawer: store first, define later, each item keeping its related data together.

  5. spreads easily, weaker guarantees
    5

    No fixed shape means it spreads across many machines easily — but often with weaker guarantees.

  6. SQL core data NoSQL caches · logs +
    6

    Neither wins. Many systems use a relational core plus a NoSQL store for caches and logs.

Strict labelled folders versus a drawer you toss anything into — a different bargain about structure.

What "relational" really buys you

In a SQL database, data is split into tables that reference each other — customers, orders, products — and the database can stitch them back together on demand with a join. The fixed schema means it can enforce rules and answer complex questions reliably.

The cost is rigidity: changing the shape later, or spreading one logical table across many servers, takes real effort.

What NoSQL gives up, and gains

NoSQL stores tend to keep related data together in one blob (a document) and avoid joins, which makes them simple and fast to scale horizontally. The trade is that they push more responsibility onto your application and often offer weaker, eventual consistency.

A common pattern is to use a relational database for the core, trustworthy data and a NoSQL store for things like caches, sessions, or high-volume event logs.

The real version SQL vs NoSQL, in depth →
Found this useful?