Databases

After this course you can pick the right database for a workload, model data for it, make it fast, keep it consistent, run it in production, and explain the history and research that explain why it works that way.

29/56 CHAPTERS5 MODULES~34 H WRITTEN SO FAR
START WITH What a database is for ▸
LAB STACK

Postgres 17 in Docker with a generated 'shop' dataset of about ten million rows, plus one-off containers for MySQL, SQLite, Redis, MongoDB, Cassandra, ClickHouse, DuckDB, CockroachDB and TiDB as chapters need them. Every lab runs on a laptop with Docker Compose; labs that need more than 8 GB of RAM say so. The Storage path's eleven simulations are embedded where they fit.

SHOW UP TO

BEFORE YOU START

This course assumes you can already do the following. Each line says where ATLAS teaches it.

MODULE 1

Relational foundations

BEGINNER 7/7 WRITTEN

SQL, modelling, transactions and indexes from the outside. You finish with a real schema, a loader and thirty correct, indexed queries.

  1. 01 What a database is for Durability, concurrency and queries: the three jobs a file cannot do, and the first one you lose data to 45 MIN
  2. 02 The relational model and SQL: SELECT through JOIN Relations, keys and NULL, then the whole join family, then how to read a result that is wrong before anyone else does 55 MIN
  3. 03 Modelling: keys, normalisation, and when to denormalise Design the shop schema from its requirements, learn which update anomaly each normal form prevents, then break a rule on purpose and keep it honest 55 MIN
  4. 04 Aggregation, window functions, CTEs GROUP BY collapses rows, windows keep them: top-N per group, running totals and gaps-and-islands, and the EXPLAIN that shows when a window beats a self-join 55 MIN
  5. 05 Transactions and ACID from the outside Two psql sessions, one stock count: watch a rollback undo everything, a dirty read fail to happen, and a sale vanish, then stop it three ways 50 MIN
  6. 06 Indexes from the outside: when a query gets fast Read EXPLAIN (ANALYZE, BUFFERS), add the index that turns 3,600 page reads into 10, and learn the four rules that decide whether the planner will use it 55 MIN
  7. 07 Project: build and query the shop databasePROJECT Load ten million rows, answer thirty business questions with correct SQL, make every one of them fast with indexes you can defend, and prove the data is consistent 180 MIN
MODULE 2

How the engine works

WORKING 10/11 WRITTEN

Pages, B+ trees, the write-ahead log, MVCC, isolation anomalies, locks, the planner, LSM trees and connection handling. Each one with the ATLAS simulation that breaks it.

  1. 08 Storage: pages, heaps, tuples and the buffer pool Every row lives in an 8 KB page, every page passes through one cache, and most slow queries are a story about which pages were not in it 55 MIN
  2. 09 B+ trees in the engine What a Postgres btree index does with high keys, splits, duplicates and dead versions, how it bloats, how to measure that, and the two updates that never touch it 55 MIN
  3. 10 Write-ahead logging, checkpoints and crash recovery Every change is written twice, once to a log that is fsynced and once to a page that is not, and recovery is the art of making the second copy agree with the first 55 MIN
  4. 11 MVCC, snapshots and vacuum Every UPDATE is an INSERT with a tombstone, and someone has to take the rubbish out before the transaction counter wraps 55 MIN
  5. 12 Isolation levels and the anomalies catalogue The four ANSI levels, the seven anomalies they were meant to name, and what Postgres and MySQL actually do at each one 50 MIN
  6. 13 Locking, deadlocks and lock escalation Eight table lock modes, four row lock modes, one queue, and the ALTER TABLE that takes the site down while waiting for a SELECT 50 MIN
  7. 14 The query planner: statistics, cost, join algorithms How Postgres guesses row counts, prices plans and picks a join, and the three ways the guess goes wrong 55 MIN
  8. 15 LSM trees and the write-optimised world Memtables, SSTables, compaction and the triangle of read, write and space amplification you cannot escape 50 MIN
  9. 16 Connection handling, pooling and the process model Why 2000 connections make Postgres slower than 50, what PgBouncer does about it, and what transaction pooling quietly breaks 55 MIN
  10. 17 Application access: ORMs, N+1 queries and what the driver hidesCOMING
  11. 18 Project: diagnose five slow queries under loadPROJECT Five queries against the shop, five different reasons they are slow, and one diagnostic sequence that finds each of them 180 MIN
MODULE 3

Beyond one relational node

SENIOR 12/13 WRITTEN

Replication, failover, sharding, distributed transactions, consistency models, and the non-relational landscape: key-value, document, wide-column, columnar, search, graph, time-series, vector. Ends with a decision framework and a live resharding.

  1. 19 Replication: physical, logical, sync and async Ship the WAL to another machine, measure how far behind it is, lose a commit you acknowledged, then pay to stop losing it 60 MIN
  2. 20 Failover, split brain and fencing Detecting a dead primary is a guess, promoting a replica is easy, and making sure the old primary stops writing is the whole job 60 MIN
  3. 21 Partitioning and sharding Split a table inside one server first, then across servers; pick the key that decides which queries stay cheap, and move data without stopping writes 60 MIN
  4. 22 Distributed transactions: 2PC, Percolator, and Spanner's clock One commit across many machines: the protocol that blocks, the three designs that stop it blocking, and the clocks they lean on 60 MIN
  5. 23 Consistency models in practice Linearizable, sequential, causal, read-your-writes, snapshot: what each one promises, what it costs, and how to catch your database breaking it 55 MIN
  6. 24 Key-value and document stores: Redis, DynamoDB, MongoDB Start from the access patterns, then pay for every query you did not list: the shop modelled three ways 60 MIN
  7. 25 Wide-column stores: Cassandra and Bigtable Partition keys, clustering, quorum maths, tombstones and compaction: Bigtable's storage engine under Dynamo's replication, and where each half bites 60 MIN
  8. 26 Columnar and analytics: ClickHouse, DuckDB, Parquet, the lakehouse Why the same aggregate takes a second in Postgres and tens of milliseconds in a column store, and what the column store charges you for it 55 MIN
  9. 27 Search, graph, time-series, vector: the specialist engines Four workloads where a different index wins, what each engine does underneath, and how far Postgres gets before you bolt one on 60 MIN
  10. 28 Caching in front of the database Cache-aside with Redis: the race that leaves a stale value forever, the invalidation strategies that close it, and the day the cache becomes the thing holding the database up 55 MIN
  11. 29 Choosing a database: a decision framework Profile the workload against the three jobs, price the operations you are signing up for, measure how far Postgres goes, and write the decision down so it can be revisited 55 MIN
  12. 30 Embedded and local-first: SQLite, sync engines and the database on the deviceCOMING
  13. 31 Project: shard the shopPROJECT Move the live shop from one Postgres to a Citus cluster with replicas: copy, catch up, verify, switch, with a load running the whole time and a checker that proves nothing was lost 240 MIN
MODULE 4

Running databases in production

STAFF 0/13 WRITTEN

Zero-downtime migrations, backups you have restored, capacity, observability, security, multi-tenancy, change data capture, warehousing, the cloud offerings and their bills. Ends with a production readiness review.

  1. 32 Schema migrations without downtimeCOMING
  2. 33 Backups, PITR and testing restoresCOMING
  3. 34 Capacity planning and performance testingCOMING
  4. 35 Observability for databasesCOMING
  5. 36 Security: auth, row-level security, encryption, auditingCOMING
  6. 37 Multi-tenancy patternsCOMING
  7. 38 Change data capture and the outbox patternCOMING
  8. 39 Data warehousing, ELT and the modern data stackCOMING
  9. 40 Cloud managed databases: RDS, Aurora, Cloud SQL, Spanner, Neon, PlanetScaleCOMING
  10. 41 Serverless and disaggregated storageCOMING
  11. 42 Cost engineeringCOMING
  12. 43 Open table formats: Iceberg, Delta and the catalogueCOMING
  13. 44 Project: the production readiness reviewCOMING
MODULE 5

Research, history and judgment

PRINCIPAL 0/12 WRITTEN

How to read database papers, and the ones that matter: transaction theory, modern concurrency control, optimiser research, storage research, distributed designs, HTAP, streaming, formal verification, and the Postgres source. Ends with a strategy memo.

  1. 45 The Red Book: how to read database papersCOMING
  2. 46 Architecture of a Database SystemCOMING
  3. 47 Transaction processing theory: serializability, recoverability, ARIES in fullCOMING
  4. 48 Modern concurrency control: OCC, MVCC variants, Silo, Hekaton, CalvinCOMING
  5. 49 Query optimisation research: Cascades, learned optimisers, adaptive executionCOMING
  6. 50 Storage research: learned indexes, Bw-tree, LSM tuning, and what persistent memory taughtCOMING
  7. 51 Distributed databases research: Spanner, Calvin, Aurora, SnowflakeCOMING
  8. 52 NewSQL and HTAP: TiDB, CockroachDB, YugabyteDB, SingleStoreCOMING
  9. 53 Stream processing and the database inside-outCOMING
  10. 54 Formal verification and testing databases: Jepsen, TLA+, deterministic simulationCOMING
  11. 55 Postgres internals: reading the sourceCOMING
  12. 56 Capstone: database strategy for a companyCOMING