DatabasesVol. 4 · Part IV
0 / 0

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.

12 chapters◷ ~5 h to read ✓ 303 topics? 12 quizzes

Two ways to read this book

New to the subjectStart with the opening Start Here chapter and read chapters in order. In each chapter, read the Start here section, run its examples, answer Check yourself before opening the answers, and take the quiz. Read the deeper sections once the Start here quiz is easy; leave the hardest parts for a second pass. Build the projects in the final chapter as you go.
Experienced engineerSkip the opening chapter. In each chapter, read the Revision sheet at the end first and take its quiz; skim Start here; then use How deep to go to pick the internals sections and lab experiments that fill your gaps. Tick a topic only when you could teach it.

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

  1. 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.
  2. Run the code. Every comparison block has tabs for each language; type the example out in at least two of them.
  3. 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.
  4. Revisit after a delay. The roadmap's loop applies: recall, explain, implement without notes, break it, measure it.

Mastery levels

L1 RecognitionDefine it and identify it.
L2 WorkingUse it correctly in code or config.
L3 InternalsExplain why it works.
L4 DebuggingDiagnose failures and performance problems.
L5 DesignChoose among competing approaches.
L6 ProductionOperate it under scale, failure, security and cost.

Languages used throughout

PostgreSQL 18MySQL 8.4 · InnoDBSQLiteSQL Server · OracleRedis · MongoDB · Cassandra · DynamoDBElasticsearch · OpenSearchJava · Go · Rust · Python clients

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

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. DB·60Query OptimisationMaking queries fast on purpose. Covers how the optimiser decides (selectivity, cardinality, statistics and cost), scans (sequential, index…23 min
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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