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
- 1What Is a Database?
The starting point: what a database is and why we need one.
- 2ACID
The four guarantees that make transactions safe.
- 3What Is an Index?
Why some queries are instant and others scan every row.
The Evolution of Storage Eras
RDBMS → NoSQL → Distributed SQL → Vector — why today's storage landscape has this many moving parts.
What Is a Database?
Tables, rows, columns, and schemas — the mental model every other chapter in this journey builds on.
Data Modeling & Normalization
1NF through 3NF, and why your data ends up split across multiple tables in the first place.
Primary Keys, Foreign Keys & Constraints
How a schema enforces its own correctness — and how foreign keys link the tables normalization just split apart.
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.
SQL Fundamentals
SELECT, WHERE, GROUP BY, ORDER BY, and subqueries — the core query vocabulary every storage system eventually speaks.
Mastering SQL Joins
INNER, LEFT, RIGHT, FULL OUTER, CROSS, and SELF joins — reassembling the tables normalization split apart.
Stored Procedures & Functions
Reusable, server-side SQL logic — and the real trade-off of putting logic in the database versus the application.
Views & Materialized Views
A saved query that runs live, versus a saved query that's precomputed and refreshed on a schedule.
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.
ACID
The four guarantees a relational transaction makes about what happens when things go wrong partway through.
BASE
The consistency model most NoSQL and distributed systems choose instead of ACID — and why that's a deliberate trade, not a lesser one.
MVCC
How Postgres-style engines let reads and writes happen at the same time without ever blocking each other.
Isolation Levels
How strictly a database stops one transaction from seeing another's in-progress changes — and the anomaly each level still allows.
B+ Tree
The balanced, disk-page-based structure Postgres, InnoDB, and SQLite use to keep both lookups and range scans fast.
LSM Tree
The append-only storage engine design behind Cassandra and RocksDB — built for write throughput a B+ Tree can't match.
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.
Relational Databases & Scaling
The standard toolkit for scaling a relational database further — connection pooling, read replicas, and sharding, roughly in that order.
Query Optimization & EXPLAIN Plans
How to find out why a query is actually slow, instead of guessing from how the SQL looks.
Document & Wide-Column Stores
Two different NoSQL data models, both built for scale — flexible nested documents versus partition-key-distributed rows.
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.
Search & Inverted Indexes
The data structure behind full-text search — mapping words to documents, the exact opposite direction a normal index goes.
Distributed SQL Systems
How Spanner and CockroachDB combine sharding, consensus, and distributed transactions to deliver global ACID over SQL.
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.