Shelves / Databases
Software Engineering · Volume 4
Databases
Part IV of the Software Engineering roadmap, written out as a textbook that starts from zero. The opening chapter assumes you have never used a database; every later chapter opens with a plain-language Start here section whose queries and programs were actually run, then goes all the way to internals: the relational model, SQL through window functions, PostgreSQL in depth (MVCC, VACUUM, WAL, replication, versions 17 to 19), storage engines (B-trees, BRIN, GIN, LSM trees), transactions and isolation, query optimisation, scaling and failover, NoSQL and column stores, search and vector retrieval, and backups and recovery. Each chapter ends with a lab of real measurements and a revision sheet, and a final chapter of eight projects builds one data platform end to end.
Two ways to read this book
Every chapter has the same shape: Start here (first principles, plain language, small verified examples) → How deep to go (what each mastery level needs) → full-depth sections → Lab (experiments with real measured output) → Revision sheet (key ideas, numbers to remember, pitfalls, glossary, quiz).
How to use this book
- Read one topic at a time. Each topic heading has a Done tick. Tick it only when you can explain the idea aloud without looking, which is roughly mastery level L2–L3 below.
- Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
- Take the chapter quiz at the end. A score of 80% or more counts as passed. Wrong answers show the explanation, so re-read that topic and untick it if needed.
- Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.
Mastery levels
Languages used throughout
SQL examples target PostgreSQL 18 (the current stable major version; PostgreSQL 19 was in beta during 2026) unless another engine is named. Features new in a version are labelled with it. Check your server version (SELECT version();) and the release notes before relying on a recent feature.
Contents
- DB·00Start Here: What a Database IsFor readers who have never used a database: why files aren't enough, what a database guarantees, a first PostgreSQL session explained line by line…10 min
- DB·55The Relational ModelThe ideas underneath every SQL database: relations, tuples and attributes, tables, rows and columns, domains and data types, keys (candidate…28 min
- DB·56SQL from SELECT to Window FunctionsSQL as a declarative language: the logical processing order, filtering, sorting and paging, joins of every kind (including semi- and anti-joins)…33 min
- DB·57PostgreSQL in DepthHow PostgreSQL works and how to run it: the process architecture, databases, schemas and search_path, roles, privileges and row-level security…31 min
- DB·58Storage Engine InternalsWhat a database actually does with your rows. Covers pages and the slotted-page layout, heap storage versus clustered (index-organised) tables…25 min
- DB·59Transactions and Concurrency ControlWhat ACID really promises, isolation levels and the anomalies they allow (dirty reads, non-repeatable reads, phantoms, lost updates, read skew, write…27 min
- DB·60Query OptimisationMaking queries fast on purpose. Covers how the optimiser decides (selectivity, cardinality, statistics and cost), scans (sequential, index…23 min
- DB·61Scaling DatabasesHow to grow a database past one server. Covers the scaling ladder (query and index work, vertical scaling, connection pooling, caching, read…21 min
- DB·62NoSQL Data Models and StoresThe non-relational families and when they beat SQL. Covers key-value, document, wide-column and graph models (plus time-series and vector stores)…26 min
- DB·63Search Engines and Hybrid SearchHow search engines find and rank text. Covers the inverted index, analysis (character filters, tokenisation, token filters), stemming and…25 min
- DB·64Durability, Backups and RecoveryMaking sure data survives everything from a disk failure to an accidental DELETE to ransomware. Covers RPO and RTO, what replication does and doesn't…21 min
- DB·65Database ProjectsEight build-it-yourself projects that grow one data platform, the tiffin centre's, from a well-designed schema to a tuned, concurrent, replicated…8 min