A database keeps an application's data safe, correct and quick to find while many people use it at once; each kind of database buys that for one access pattern by choosing what it stores together, so start with one Postgres and add another store only when a measured problem needs what it makes cheap.
The running example is the one the Topic: swe-and-system-design page uses: a chat assistant powered by a large language model (LLM). People sign up (users), open conversations (chats), send and receive messages, and spend prepaid credits. Every child page of this topic measures the same product, so their numbers line up. The figure shows where its data lives at three moments; each store added later is a second copy of some fact, with its own lag, and a child page owns it.
chats.json at start-up and writes the whole file back after every message. Section 1 shows the three ways that breaks.You need: nothing; the page starts from zero and defines each term where it first appears. The system around the database (servers, queues, failure) is Topic: swe-and-system-design; the page cache and fsync under it are Storage and file systems.
New terms (each defined again where it is used):
Three tools on this page span several children: the SQL playground runs real SQL on the chat tables in your browser (the SQL lessons, then the credit transfer the transactions page reuses), Query plans shows how Postgres executed eight real queries on a 10-million-message table (indexes, joins, estimates, rows against columns, caches), and the Database atlas compares every family and its main products.
A family is a data model plus a storage layout tuned for one access pattern: whatever one planned question reads is stored side by side, so that question is cheap and the questions nobody planned become scans. Read across a row; the price column is the part that only shows when the families are side by side. Postgres does a passable version of several rows through extensions (jsonb, full text, pgvector, partitions), which is why it stays the default until a measurement says otherwise.
| Family (examples) | Kept together | Cheap | Hard, and the price | In the chat product | Owner |
|---|---|---|---|---|---|
| Relational row store (Postgres, MySQL, SQLite) | A whole row in an 8 KB page; indexes sorted by key | Point reads and writes, joins, transactions across rows, questions nobody planned | Scans of a few columns over everything; writes beyond one machine | Users, chats, messages, credits: the source of truth | SQL and data modelling, Transactions and concurrency, Storage engines and indexes, Query planning and performance, Running Postgres in production |
| Key-value (Redis, Valkey, DynamoDB) | One value per key | Get and set by key: microseconds in memory (Redis), any scale if every access names its key (DynamoDB) | Any question not by key; Redis copies to replicas asynchronously, so a failover can lose writes it already acknowledged | The cached chat list, rate-limit counters, sessions | NoSQL in practice (sections 3, 4); Caching |
Document (MongoDB, Firestore; Postgres jsonb) | One nested record, read and written whole | Records whose shape varies and are always read as one unit | Joins and multi-document rules are weaker or slower; "no schema" becomes many schemas | Tool-call payloads of varied shape, usually a jsonb column instead | NoSQL in practice (section 5) |
| Wide-column (Cassandra, ScyllaDB, Bigtable) | Rows sharing a partition key, sorted inside it, on the machines that key maps to | Write volume beyond one machine, many regions, queries known in advance | No joins; a new question needs a new table; the partition key is permanent | Messages, at a scale few products reach | NoSQL in practice (section 6) |
| Search (Elasticsearch, OpenSearch; Postgres full text) | An inverted index: each word with the documents that contain it | Words, phrases, typos, facets, ranking with BM25 | Another copy, refreshed about a second behind, that must be rebuildable from the source of truth | Search over chat history by words | Search and vector databases (sections 1 to 6, 13) |
| Vector stores (pgvector, Qdrant, Milvus, Pinecone, Turbopuffer) | Embeddings in an approximate nearest-neighbour index (HNSW, IVF) | Nearest neighbours by meaning, in milliseconds | Approximate by design; indexes large and slow to build; filters can starve the result | RAG retrieval, semantic cache, deduplication | Search and vector databases (sections 7 to 12; Turbopuffer and the other dedicated stores against Postgres in section 12); index internals: Vector indexes from the inside |
| Time-series (TimescaleDB, InfluxDB, Prometheus) | Time-sliced chunks, compressed, dropped on a schedule | Steady appends and "last hour" ranges; retention by dropping whole chunks | Anything that is not a time range; a column store often does the same job | Latency and tokens per second for every request | NoSQL in practice (section 7); Observability |
| Graph (Neo4j, Memgraph, Kuzu) | Each node with its edges | Paths and patterns of unknown depth (fraud rings, inherited permissions) | Another system, and no faster at counting: up to three hops Postgres joins won | Rarely needed | NoSQL in practice (section 8); GraphRAG and structured retrieval |
| Column store and lakehouse (DuckDB, ClickHouse, BigQuery, Snowflake, Redshift; Parquet with Iceberg or Delta) | Each column's values, compressed, with min and max per block | Scans and aggregates of a few columns over millions of rows (section 5: about 94 times fewer bytes) | Updating single rows; a second copy that is always somewhat behind | Tokens per model per day; training data, eval results, logs | Analytics: columnar engines, DuckDB and the lakehouse |
| Embedded (SQLite, DuckDB) | A library inside your program and one local file | No server, no network: phones, desktop apps, tests, notebooks, one-machine jobs (SQLite is likely the most deployed database of all, over a trillion in use, sqlite.org) | One machine; SQLite allows one writer at a time | History cached on the phone; analysis in a notebook | NoSQL in practice (closed Depth); Analytics (section 6, DuckDB) |
| Distributed SQL (CockroachDB, Spanner, TiDB, YugabyteDB) | Ranges of rows, each copied to several machines that agree on every change (Raft or Paxos) | SQL and transactions beyond one machine, or surviving the loss of a region | Every write waits for a quorum (more latency across regions); transactions spanning ranges are slower; more to pay and run | Only at very large scale | Scaling a database (sections 11, 12) |
Two things are roles, not families. A cache is any fast store (usually Redis) holding copies of answers already computed: Caching owns every layer of it. Object storage (S3 and its equivalents) holds files and the Parquet files a lakehouse is made of: Analytics owns it as table storage. And two subjects are split between pages: pools (how many connections give the most throughput is Query planning and performance section 8; PgBouncer's modes and traps are Running Postgres in production section 7; sizing a pool with Little's law is Capacity planning and performance), and the lock queue (which ALTER TABLE takes which lock is SQL and data modelling section 11; finding the blocker on a live server is Running Postgres in production section 8).
Ben sends a message that costs one credit. Following that one write from his request to the copies it feeds touches every child of this topic, in this order. Predict before it plays: of the eleven steps, how many happen before the database says "committed"?
Six steps decide whether the write is correct and durable; five more keep its copies in step afterwards
UPDATE credits SET balance = balance - 1 WHERE user_id = 2 AND balance > 0, then INSERT INTO messages; constraints refuse a message for a chat that does not exist. SQL and data modelling sections 6, 10balance > 0 and changes nothing. Transactions and concurrency sections 1, 6user_id rather than reading the whole table. Query planning and performance sections 1 to 6messages, while the credits update can skip its indexes when no indexed column changed (a HOT update). Storage engines and indexes sections 1, 2, 5, 11; Transactions and concurrency section 5The order of events is Postgres's documented behaviour; the user and the statements are the sample rows of section 1.
Six (steps 1 to 6) happen before "committed"; the commit waits only for the log flush, never for the page itself, the replica, the cache or the copies.
Day one, the chat app keeps everything in one file, chats.json, read at start-up and written back whole after every message. Three things break it, each at a different size: two requests at once each write the whole file and one message vanishes with no error; a power cut half-way through a write leaves a file that may not even parse; and every question ("user 17's chats") reads the whole file, gigabytes at ten million messages illustrative.
A database (properly a database management system) is a separate program that owns the data; the app sends it requests over a connection. It promises four things a file cannot: durability (once it says "saved", a crash cannot lose it; section 4), safe concurrent access (section 3), queries that find answers without reading everything (sections 2 and 4) and constraints, rules checked on every write ("every message belongs to an existing chat").
Most databases you meet first are relational, after Edgar Codd's 1970 paper (Codd, CACM 1970): data in tables, one per kind of thing, with named columns and one row per thing. A primary key names a row; a foreign key stores another row's key, and that pointer is the "relation". The chat product needs four tables. Click a row: the rows it points to, and the rows that point to it, light up.
The price: a server to run, back up and upgrade; a network hop per request (a fraction of a millisecond in one data centre); and a schema you change by deliberate migrations. An embedded database such as SQLite gives the promises without a server, in one file (the map's Embedded row).
Click a row to follow its keys.
SQL (Structured Query Language) is declarative: you describe the result and the database works out the steps (section 4 shows who chooses). Six clauses cover most of what an app asks:
SELECT id, role, tokens -- which columns FROM messages -- which table WHERE chat_id = 11 -- which rows ORDER BY id DESC LIMIT 50; -- in what order, how many
JOIN combines rows of two tables whose keys match; GROUP BY collapses rows sharing a value into one row with an aggregate such as count(*) or sum(tokens); INSERT, UPDATE and DELETE change data. A query is written in one order and evaluated in another: FROM and the joins, then WHERE, grouping, the SELECT list, then sorting (the PostgreSQL SELECT reference lists the order).
The schema declares the tables, and each constraint in it (NOT NULL, CHECK (tokens >= 0), REFERENCES chats(id), UNIQUE) is checked on every write, whichever code path sends it. Normalisation is storing each fact once (the email in users, a key everywhere else), so a change is one write rather than an update anomaly where two copies disagree. Copying facts on purpose to skip joins is denormalisation: faster reads, and every copy is yours to keep in step; analytics and wide-column stores do it deliberately, an app's source of truth usually should not.
Ben has 1 credit and presses send in two browser tabs at once. Each request reads his balance, sees 1, calls the model, saves the reply and writes 0. Run against a real Postgres for this page, each request inside BEGIN and COMMIT: both messages were saved and the balance ended at 0 measured. That is a lost update: a write based on a value that was already stale.
A transaction groups reads and writes into one unit that commits or rolls back whole. ACID (Haerder and Reuter, 1983, ACM Computing Surveys) names its promises: atomic (all or nothing), consistent (every constraint holds after each commit; business rules beyond constraints stay your code's job), isolated (concurrent transactions do not see each other's half-done work; how much is a setting) and durable (section 4). Ben's run was inside transactions and still lost the update, because the isolation level Postgres uses by default, read committed, lets each statement see whatever was committed before it started. The levels are best read by the anomalies they still allow (Postgres documentation):
| Level in Postgres | Dirty read | Non-repeatable read | Phantom | Serialization anomaly (write skew) |
|---|---|---|---|---|
| Read committed (default) | no | possible | possible | possible |
| Repeatable read | no | no | no in Postgres (the SQL standard allows it) | possible |
| Serializable | no | no | no | no |
Write skew: two transactions each read the same rows, each make a decision valid alone and write different rows, and together they break a rule (two doctors both going off call). Postgres isolates without locking every read through MVCC: an update writes a new row version and readers keep their snapshot, so "reading never blocks writing and writing never blocks reading" (Postgres MVCC).
The three fixes, in the order a professional reaches for them: fold the check into the write (UPDATE ... WHERE balance > 0, and call the model only if one row changed); lock the row you will change (SELECT ... FOR UPDATE); or run serializable and retry on a serialization error, which also catches anomalies you did not think of, such as write skew. The last two were run on Ben's two tabs: one reply sent, balance 0 (serializable aborted the second tab with could not serialize access due to concurrent update) measured. The price: locks make others wait and two waiting on each other is a deadlock; serializable turns conflicts into errors to retry; old row versions pile up until vacuum removes them, and a transaction left open (never across a model call) stops that clean-up.
On the laptop measured for this page, opening one chat of a 1,000,000-message table (the messages of chat 42000) read 19,349 pages and took 28 ms to return 6 rows measured; with an index it read 12. Four pieces explain that gap and the promise that "saved" survives a power cut; each has a child page.
| Piece | What it is | Measured here (1,000,000 messages) | Owner |
|---|---|---|---|
| Page and buffer pool | Every table and index is an array of 8 KB pages, always read whole; pages in use are cached in RAM (shared_buffers, 128 MB by default). Memory answers in about 100 ns, a fast SSD in about 100 µs. | The table is 19,235 pages (157 MB), about 52 rows a page; of the scan's 19,349 page reads, 14,435 were found in the buffer pool and 4,914 came from the operating system | Storage engines and indexes (sections 1, 2) |
| Write-ahead log (WAL) | Before a data page changes on disk, the change is appended to a sequential log and flushed with fsync; the commit waits only for that. Pages are written later at a checkpoint; after a crash the log is replayed. The same records keep a replica current and restore a backup to any moment. | A small write transaction took 6.3 ms with a real flush against 0.42 ms without one; with real flushes, 148 write transactions a second from 1 client and 2,133 from 32, because one flush covers many commits | Storage engines and indexes (sections 3, 4); Running Postgres in production (sections 1 to 3) |
| Index (B-tree) | A separate tree of pages kept sorted by a column, hundreds of keys a page, so millions of rows sit three or four levels deep. Every write must also update every index. | Index on chat_id: 12 pages instead of 19,349 (Buffers: shared hit=12); it takes 9.3 MB, 6% of the table | Storage engines and indexes (sections 5, 9 to 11) |
| Query planner | Chooses how to run a query (scan or index, join order, join method) from cost estimates built on statistics; EXPLAIN shows the plan, EXPLAIN ANALYZE runs it and adds actual rows and times. It goes wrong when its estimates do: compare estimated with actual rows, step by step. | Eight real plans on 10,000,000 messages, each before and after its fix, in Query plans | Query planning and performance |
An index costs every insert and update and helps only queries that filter or sort on its leading column: index what your queries search by, measure, drop what nobody uses. The B-tree's write-optimised rival, the LSM-tree (Cassandra, RocksDB), trades reads for cheap writes; Storage engines and indexes measures both (section 7).
PostgreSQL 16.2 (the pgserver wheel) and DuckDB 1.5.6 on an Apple M1 Pro laptop, 2026-10-04: 1,000,000 messages over 100,000 chats, generated by src/read/measure_read.py (outputs in src/read/inputs/read_measure.json, checked by src/read/recompute.py). The transaction runs gave Ben's credits row user_id 17 instead of the sample table's 2, which changes nothing; the second session started 0.1 seconds after the first. The transaction rates are the atlas agent's pgbench run with fsync_writethrough, which really flushes the drive cache on macOS. Server SSDs flush far faster than a laptop's; the Numbers to know tab of the system design page has both.
OLTP (online transaction processing) is what the app does: many small reads and writes, each of a few whole rows, each in milliseconds. OLAP (online analytical processing) is what analytics does: few large queries reading a few columns of a huge number of rows. A row store such as Postgres keeps each row's values side by side, so one whole row is one page read; a column store keeps each column's values side by side, so a query reads only the columns it names, and values that look alike compress far better.
The same question, "tokens per model", over the same 1,000,000 messages: Postgres read 157.7 MB (19,251 pages) in 70 ms, because every page holds whole rows including the text the question never looks at; DuckDB read the two needed columns of a Parquet file (an open column-oriented format, each column of each block of rows compressed separately with its min and max, Parquet docs), 1.68 MB in 2.6 ms measured. Both returned the same four totals (80,277,256 tokens for mini); the column store read about 94 times fewer bytes. The role column alone shrank from 254,530 bytes to 862. Bytes are the fair comparison; the times come from two engines. At a billion messages the row store would read about 158 GB per question (derived, linear), on the server that is answering users. Query plans case 6 repeats it at 10,000,000 messages: 1.47 GB against 17.3 MB of two Parquet columns, 87 times fewer bytes.
The price: a column store rewrites compressed blocks to change one row, so it is built for appending in bulk; and it is a second copy fed from Postgres (a nightly export or a stream of changes), always somewhat behind. Where it runs: DuckDB inside your program on Parquet files; ClickHouse as a server you run; BigQuery, Snowflake and Redshift as managed services with storage apart from compute; a lakehouse is Parquet on object storage plus a table format (Iceberg, Delta Lake) that adds safe concurrent commits, so several engines share the files.
Bytes read for "tokens per model" over the same 1,000,000 messages, on a log scale (each gridline is 10 times the last). Top bar: the 19,251 Postgres pages read. Below: the Parquet file's seven columns as stored, compressed; the two the query reads (model and tokens) are coloured and add up to 1.68 MB. The content column, the text of every message, is the largest by far (83.5 MB before compression, 22.4 MB in Parquet), and a row store carries it on every page it reads. Measured for this page (section 4's details).
The product grows and some requests stop fitting one relational database well: the chat list rebuilt from the same query thousands of times a minute, search by words and by meaning, a latency measurement every second from every server. There are hundreds of products but about ten families (the map above), each the answer to one such problem. Three measured results show the price of reaching for one too early:
What every extra family costs: a second copy of some facts with its own lag, failure modes, backups, upgrades and on-call knowledge. The question is never "is this tool better at X" but "is X now painful enough, measured, to pay for another system". Postgres's full-text ranking (ts_rank) is not BM25, Redis can lose acknowledged writes in a failover, and a partition key decides forever which machine holds a wide-column row: each family's fine print is on its owner page.
Every vendor's benchmark shows its product winning, and a database is one of the hardest things to change later. So the choice needs a method, applied when a measured limit forces you off the default. Five questions, in this order:
Applied to the chat product, the answers explain the fleet in the opening picture:
| Data | Access pattern | Rules across rows | Store |
|---|---|---|---|
| Users, chats, messages, credits | By user and chat; new questions every month | Yes: credits and replies change together | Postgres (the source of truth) |
| Chat list, rate-limit counters | Same key read constantly; a little staleness is fine | No | Redis, as a cache built from Postgres |
| Tokens per model per day | Scans of two columns over everything | No; minutes behind is fine | Column store, copied from Postgres |
| Search history by meaning | Nearest neighbours of an embedding | Must respect who may see which chat | pgvector inside Postgres first (section 8) |
The two doors that only open one way. Almost every choice can be undone with a migration; two cannot without rewriting every row. When data is split across machines (sharding), the shard key decides where each row lives: shard by user and "all of one user's chats" is fast while "all chats about a topic, across users" asks every machine. In a wide-column store the partition key plays the same role. Choose either from the queries you will run most and check no single key will be too busy. One more decision is cheapest at schema time: how long each kind of data is kept and how it is deleted (a user's right to erasure, where data may live, audit retention); a store with no practical way to delete one user's rows is one you will migrate off.
A rule of thumb, kept as advice (opinion, not a sourced claim): start with Postgres + S3 (object storage for files and Parquet) + Redis, add a column store when analytics queries hurt, add Kafka when more than two systems need the same events. Each addition is a row of the map with its price; Distributed systems fundamentals keeps the same rule.
The chat product adds retrieval-augmented generation (RAG): before answering, it finds the passages of a user's documents closest in meaning to the question and puts them in the prompt. Each passage now has an embedding plus the facts any app needs: owner, who may see it, source document, and a way to delete it. The team also trains and evaluates models on chat logs. Four database ideas carry most of this, each owned by a child.
| Idea | What it means here | Owner |
|---|---|---|
| Vectors next to the rows: pgvector first | pgvector adds a vector column and ANN indexes (HNSW, a layered graph walked greedily, Malkov and Yashunin; IVFFlat) to Postgres, trading a little recall (the share of the true nearest neighbours returned) for speed. The passage, its owner, its permissions and its embedding become one row: one transaction writes them, one delete removes them, one backup holds them. Its limits are memory (a 1,536-dimension vector of 4-byte floats is 6,152 bytes as pgvector stores it, about 615 GB per hundred million before any index, derived) and filters applied after the index scan. A dedicated store earns its place when vectors outgrow one server or filtered search dominates; measure recall and latency on your own data rather than trusting a vector count. | Search and vector databases (sections 7 to 12); Vector indexes from the inside |
| Feature stores are two databases | A feature store (Feast, Tecton) is an offline store of feature history for training sets plus an online store of each entity's latest values for serving: a column store (section 5) plus a key-value store (section 6), fed by the same code so training and serving do not drift. Training examples must join features as of their own timestamp (a point-in-time or ASOF join), or labels leak. | Analytics: columnar engines, DuckDB and the lakehouse (section 11); ML platforms and workflows |
| DuckDB on Parquet for datasets and evals | Training data, eval results and logs are mostly Parquet files; DuckDB queries them in place with SQL and no server (section 5's two columns of a million rows in 2.6 ms). | Analytics (sections 5, 6); Storage and loading at scale |
| A language model that writes query plans | A fine-tuned 4-billion-parameter model writing pg_hint_plan hints beat Postgres's planner by 1.40 times geometric mean on the Join Order Benchmark (Rohan Bansal, 2026-09-16), on a set also watched during development, so not a held-out result; executing candidate plans costs far more than planning once, so it pays only for one heavy query run again and again. | Query planning and performance (closed block: Learned optimizers) |
1. Start with one Postgres and a normalised schema with keys and constraints, so the database refuses bad data whichever code path sends it (sections 1, 2; SQL and data modelling).
2. Put every check-then-change inside one statement or one short transaction: a conditional UPDATE ... WHERE balance > 0 first, a row lock or serializable with a retry when the rule spans rows; never hold a transaction open across a model call (section 3; Transactions and concurrency).
3. Index for the queries you run, and read the plan: EXPLAIN (ANALYZE, BUFFERS), estimated against actual rows, pages read (section 4; Storage engines and indexes, Query planning and performance).
4. Move analytics off the app database into a column store fed from it, and accept that it lags (section 5; Analytics).
5. Add a family only for a measured problem, and write down its price: the copy, its lag, its staleness and who runs it (section 6; NoSQL in practice, Search and vector databases, Caching).
6. Treat the shard key and the partition key as permanent; everything else can be migrated (section 7; Scaling a database).
7. Keep embeddings next to the rows they describe until a measurement says otherwise (section 8; Search and vector databases).
8. Trust, but test: restore a backup on a schedule, and read what independent testers such as Jepsen found about the systems you run (Running Postgres in production; Transactions and concurrency).
Ten pages on the same chat product, each with its own measurements; in this order each assumes only this page and the ones before it. Times are the reading time each page's header states (core, plus closed details).
This tab holds a real database engine: SQLite (which its authors describe as the most widely deployed database engine), compiled to WebAssembly and running inside this page with no network. It is loaded with the chat product's data (50 users, 200 chats, 2,000 messages, one credits balance per user). Twelve short lessons take you from your first SELECT to transactions, each with a goal, a hint, a query you can edit and run, and what the result means.
Every lesson was also run, offline, on real PostgreSQL, the database the Reading tab recommends as the default. Its recorded result sits next to the live one, and where the two engines disagree the difference is the lesson: eight of the 45 menu choices differ, and each one is a trap that has bitten real teams.
A table is a named set of rows with fixed columns. A primary key (PK) is a column whose value is unique and never empty, so it names exactly one row. A foreign key (FK) is a column holding another table's primary key: chats.user_id says which user owns the chat. That pointer is the "relation" in "relational database".
The same text creates the tables in both engines, except that Postgres declares each id as INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY so it, like SQLite, picks the next id when an INSERT leaves it out. The rows come from a seeded generator (src/sql/gen_data.py): the same 2,300 rows every time, with a few gaps on purpose (5 users without a country, 6 users without chats, 37 chats without a title, 8 chats without messages) because gaps are where queries go wrong.
The same four users and their chats, joined step by step. For each user on the left, the database looks for chats whose user_id equals that user's id, and writes one output row per match. Switch to LEFT JOIN to see the one difference: a user with no match still gets a row, with NULL in the chat columns.
Real rows from the lesson's data. A real engine does not always loop like this: with an index on chats.user_id it jumps straight to the matching chats, and on big tables it may build a hash table of one side first. The Query plans tab shows which method Postgres picks and why.
Your own database: changes here persist between runs until you press Reset data. Write several statements separated by ;. Try a starter, or anything you like.
You write SQL that says what you want; a part of the database called the planner decides how to get it: which table to read first, whether to use an index, how to match rows from two tables. The recipe it picks is the query plan. Here are eight real plans, measured on this page's chat product with 10 million messages, each before and after the change that fixes it.
shared_buffers, 128 MB here). A page found there is a hit. A page it must ask the operating system for is a read; the operating system may still have it in its own memory, or may have to fetch it from the disk (case 8 shows the three).EXPLAIN ANALYZE then runs the query and reports what really happened. When the guess is far off, the planner may have chosen the wrong recipe (case 5).Answer what you know; skip the rest. Candidate rows get a green edge in the table, and the list below says why each one fits or does not. The matching rules are this page's judgement, built from each row's cells (shown with each reason), not a vendor ranking.
Click a row for every field with its sources; tick up to three rows with "+" to compare them side by side. Rows are grouped by family when sorted by family.
Several well known databases changed licence after they became popular, usually to stop cloud providers selling them as a service, and some changed back; others changed owner while keeping their licence. Each dot is a dated event (hover for the text); tap one to open its row.
The earlier version of this topic made the claims below. Each was checked against primary sources or measured; corrections are shown, not hidden.
Every link opens in a new tab; times are estimates for a careful first read. Editions, dates and course semesters were checked on 2026-10-04.
Real SQL on the chat tables, in your browser: twelve lessons from the first SELECT to a credit transfer, every one also run on Postgres, and free play. About 20 minutes.
How Postgres actually ran real queries on a 10-million-message table: plans, estimates against actual rows, pages read: indexes, joins, a misestimate, rows against columns, index-only scans, cold and warm caches. Extends sections 4 and 5. About 20 minutes.
Every family and the main products compared: data model, consistency, scaling, when to use, when not. Extends sections 6 and 7. About 25 minutes.
What each covers is on the child cards at the end of the Reading tab; times are each page's header (core, plus closed details).
43 min, plus 5.
42 min, plus 14.
45 min, plus 11.
45 min, plus 8.
43 min, plus 22.
46 min, plus 9.
46 min, plus 16.
33 min, plus 13.
In order. Each step says when it pays to read it.
The official tutorial, PostgreSQL 18 (the current release; 19 reached Release Candidate 1 on 15 October 2026, general availability targeted for 19 November): getting started, the SQL language, then views, foreign keys, transactions and window functions. Read first, with a local Postgres open. About 2 hours.
Markus Winand's free web book on indexing across Postgres, MySQL, Oracle, SQL Server and Db2: how an index works, the WHERE clause, joins, sorting, why a query does a full scan. After section 4, before your first slow-query hunt. About 4 hours.
PostgreSQL 18 manual, section 14.1: reading plans, costs, EXPLAIN ANALYZE, and how the planner's estimates are computed. The day a query is slow, alongside the Query plans tab. About 45 minutes.
Martin Kleppmann and Chris Riccomini, O'Reilly, March 2026 (author's site). The standard book on how data systems work and fail: data models, storage engines, replication, sharding, transactions, streams. After this page, a chapter at a time. About 15 hours.
Carnegie Mellon's introductory course, Fall 2026 taught by Jignesh Patel (25 lectures from the relational model to recovery and distributed databases; this semester's videos are on CMU's Panopto). Andy Pavlo's recorded Fall 2025 lectures are public on YouTube. When you want to know how an engine is built; the projects build one. About 30 hours of lectures.
Alex Petrov, O'Reilly, 2019. Part I is storage engines (B-trees, files, the log, LSM-trees); Part II distributed systems (failure detection, consensus). After DDIA, for the level below it. About 9 hours 30 minutes.
Kyle Kingsbury's tests of what databases actually do under network faults and crashes, against what their documentation claims, with a map of consistency models. Recent: Amazon RDS for PostgreSQL 17.4 (2025). Before you choose or operate a system: read its analysis. About 1 hour per analysis.
Jay Kreps, LinkedIn Engineering, December 2013. Why one append-only log sits under replication, change streams and stream processing: section 4's WAL, generalised. The original LinkedIn address returned "not found" on 2026-10-04, so this is the Internet Archive's copy from June 2026. After section 4 and DDIA's chapter on streams. About 1 hour.
The sibling root: the same chat product from one server to ten million users, the system around the database, and the Numbers to know tab. About 21 minutes.
Idempotency keys and retries across services (section 4), pagination in API design. About 52 minutes.
Replication, partitioning, consistency models, consensus (Raft): what happens when the database is more than one machine. About 46 minutes.
The layer in front of the database: validation, errors, the data layer in a handler (pools, transactions, round trips). About 32 minutes.
Load balancing, queueing, pool sizing with Little's law and load testing (caching strategy moved to this topic's Caching page). About 39 minutes.
Delivery guarantees, Kafka, and the outbox pattern for getting changes out of a database reliably. About 40 minutes.
Logs, metrics and traces, where time-series stores are used. About 39 minutes.
LLM and ML services end to end, including their data paths. About 28 minutes.
Worked designs that choose stores from requirements. About 41 minutes, or 8 to 10 per design.
Vector search in context: chunking, hybrid retrieval, rerankers, what moves retrieval quality.
Parquet and lakehouse storage as used for training data.
How stores are deployed, backed up and monitored next to training and serving.
The training recipes (distillation, LoRA, RL) behind the query-planner model of section 8.
E. F. Codd, Communications of the ACM, 1970: the relational model. About 1 hour.
Berenson, Bernstein, Gray, Melton, O'Neil and O'Neil, SIGMOD 1995: why the standard's isolation levels are ambiguous; snapshot isolation and write skew. About 1 hour.
The manual's chapter behind section 3's table and fixes. About 40 minutes.
Malkov and Yashunin: the graph index behind most vector search. About 45 minutes.
Rohan Bansal, 2026-09-16: the section 8 result, with its measurement protocol. About 30 minutes.
Stephan Schmidt: the short argument for the Postgres default, with the extensions that replace other stores. An opinion piece. About 10 minutes.