Dev Guide

Database Concepts & Theory

ACID, indexing, storage engines, and the theory every database shares.

About Database Concepts & Theory

Every database, whatever the product, is built on the same core ideas: how data is modelled, how it is written to disk, how it is found again quickly, and how many users can change it at the same time without breaking it. These guides explain those ideas one by one.

They start with the basics — what a database is, SQL, keys and joins — and move into what happens inside the engine: indexes and B+ trees, LSM trees, write-ahead logging, transactions, isolation levels and MVCC. Later guides cover NoSQL designs, in-memory caching, search and scaling.

Each guide stands on its own, so you can jump to the concept you need. If you prefer to learn in order, the Relational Databases course covers much of the same ground step by step.

Start here

  1. 1
    What Is a Database?

    The starting point: what a database is and why we need one.

  2. 2
    ACID

    The four guarantees that make transactions safe.

  3. 3
    What Is an Index?

    Why some queries are instant and others scan every row.

1

The Evolution of Storage Eras

RDBMS → NoSQL → Distributed SQL → Vector — why today's storage landscape has this many moving parts.

7 min read
2

What Is a Database?

Tables, rows, columns, and schemas — the mental model every other chapter in this journey builds on.

6 min read
3

Data Modeling & Normalization

1NF through 3NF, and why your data ends up split across multiple tables in the first place.

7 min read
4

Primary Keys, Foreign Keys & Constraints

How a schema enforces its own correctness — and how foreign keys link the tables normalization just split apart.

7 min read
5

The SQL Sub-Languages: DDL, DML, DQL, DCL & TCL

Every SQL statement belongs to one of five sub-languages — knowing which clarifies what it actually does to the system.

6 min read
6

SQL Fundamentals

SELECT, WHERE, GROUP BY, ORDER BY, and subqueries — the core query vocabulary every storage system eventually speaks.

7 min read
7

Mastering SQL Joins

INNER, LEFT, RIGHT, FULL OUTER, CROSS, and SELF joins — reassembling the tables normalization split apart.

7 min read
8

Stored Procedures & Functions

Reusable, server-side SQL logic — and the real trade-off of putting logic in the database versus the application.

6 min read
9

Views & Materialized Views

A saved query that runs live, versus a saved query that's precomputed and refreshed on a schedule.

6 min read
10

What Is an Index?

Why an index makes a query faster, in plain terms — now that you've written enough queries to feel one run slowly.

7 min read
11

ACID

The four guarantees a relational transaction makes about what happens when things go wrong partway through.

7 min read
12

BASE

The consistency model most NoSQL and distributed systems choose instead of ACID — and why that's a deliberate trade, not a lesser one.

6 min read
13

MVCC

How Postgres-style engines let reads and writes happen at the same time without ever blocking each other.

7 min read
14

Isolation Levels

How strictly a database stops one transaction from seeing another's in-progress changes — and the anomaly each level still allows.

8 min read
15

B+ Tree

The balanced, disk-page-based structure Postgres, InnoDB, and SQLite use to keep both lookups and range scans fast.

7 min read
16

LSM Tree

The append-only storage engine design behind Cassandra and RocksDB — built for write throughput a B+ Tree can't match.

8 min read
17

Write-Ahead Logging (WAL)

The crash-recovery mechanism nearly every database relies on — whether it's built on a B+ Tree or an LSM Tree underneath.

6 min read
18

Relational Databases & Scaling

The standard toolkit for scaling a relational database further — connection pooling, read replicas, and sharding, roughly in that order.

7 min read
19

Query Optimization & EXPLAIN Plans

How to find out why a query is actually slow, instead of guessing from how the SQL looks.

7 min read
20

Document & Wide-Column Stores

Two different NoSQL data models, both built for scale — flexible nested documents versus partition-key-distributed rows.

8 min read
21

In-Memory Caching (Redis)

A single-threaded, in-memory data structure store, fast enough to answer in microseconds — with a real durability trade-off underneath.

7 min read
22

Search & Inverted Indexes

The data structure behind full-text search — mapping words to documents, the exact opposite direction a normal index goes.

7 min read
23

Distributed SQL Systems

How Spanner and CockroachDB combine sharding, consensus, and distributed transactions to deliver global ACID over SQL.

8 min read
24

Backup & Disaster Recovery

A backup you've never restored isn't a backup — it's an unverified assumption about what your data looked like at some point in the past.

8 min read