Skip to main content
RunBook Academy

PostgreSQL · Curriculum

Curriculum

127 lessons across 24 parts. Lessons build on each other; later parts assume familiarity with earlier material.

Part I

Architecture and the Process Model

What a PostgreSQL database cluster is and is not, the one-process-per-connection model, shared memory, the background processes, and the first three instruments an operator reaches for.

7 lessons
  1. 01What a PostgreSQL "database cluster" actually isArchitecture · foundation · ~25 min
  2. 02The process model: one backend per connectionArchitecture · foundation · ~25 min
  3. 03Shared memory and the buffer poolArchitecture · intermediate · ~25 min
  4. 04The background processes and what each one is responsible forArchitecture · intermediate · ~25 min
  5. 05A connection from TCP to first queryArchitecture · intermediate · ~25 min
  6. 06Inside the data directoryArchitecture · intermediate · ~25 min
  7. 07The operator's first instrumentsArchitecture · intermediate · ~30 minLab

Part II

Installation, Packaging and Service Management

Choosing a version against the support calendar, distribution versus upstream packaging, what initdb commits you to permanently, service management across distributions, and multiple clusters on one host.

6 lessons
  1. 01Choosing a version, and the support calendar that decides itInstallation · foundation · ~20 min
  2. 02Packaging, and where the packaging decides things liveInstallation · intermediate · ~25 minLab
  3. 03What initdb commits you to, permanentlyInstallation · intermediate · ~25 min
  4. 04Service management, and stopping PostgreSQL safelyInstallation · intermediate · ~25 min
  5. 05Multiple clusters on one hostInstallation · intermediate · ~25 min
  6. 06PostgreSQL in a container imageInstallation · intermediate · ~25 min

Part III

Configuration Architecture

The configuration file hierarchy and precedence, settings contexts, proving whether a change needs a reload or a restart, inspecting effective configuration, and the failure modes of ALTER SYSTEM.

6 lessons
  1. 01Where configuration comes fromConfiguration · intermediate · ~25 min
  2. 02Settings contexts, and planning a change from themConfiguration · intermediate · ~25 min
  3. 03The precedence ladder beyond the filesConfiguration · intermediate · ~25 minLab
  4. 04ALTER SYSTEM, and how it failsConfiguration · advanced · ~25 min
  5. 05Proving a change took effectConfiguration · intermediate · ~25 min
  6. 06A configuration you can hand overConfiguration · intermediate · ~25 min

Part IV

Connections, Sessions and Pooling

What a connection costs, what max_connections actually reserves, reading pg_stat_activity as an instrument, idle in transaction, connection exhaustion, and what transaction pooling breaks.

7 lessons
  1. 01What a connection costsConnections · intermediate · ~25 min
  2. 02max_connections, and what it actually reservesConnections · intermediate · ~25 min
  3. 03Reading pg_stat_activity as an instrumentConnections · intermediate · ~25 minLab
  4. 04Idle in transaction, and what it actually holdsConnections · advanced · ~30 min
  5. 05Connection exhaustion and the storm that followsConnections · advanced · ~25 min
  6. 06Why pooling exists, and the three modesConnections · intermediate · ~25 min
  7. 07PgBouncer in productionConnections · advanced · ~25 minLab

Part V

Authentication, Roles and TLS

pg_hba.conf as first-match-wins policy, what each authentication method proves, SCRAM and the MD5 deprecation, the sslmode ladder, role membership and ownership, and superuser blast radius.

7 lessons
  1. 01pg_hba.conf: first match winsAuthentication · intermediate · ~30 minLab
  2. 02Authentication methods and what each one provesAuthentication · intermediate · ~25 min
  3. 03SCRAM, password storage, and the MD5 deprecationAuthentication · intermediate · ~25 min
  4. 04TLS and the sslmode ladderAuthentication · intermediate · ~30 minLab
  5. 05Roles, membership and inheritanceAuthorisation · intermediate · ~25 min
  6. 06Ownership, default privileges, and the permission disaster they causeAuthorisation · intermediate · ~25 min
  7. 07Superuser, and what it really grantsAuthorisation · advanced · ~25 min

Part VI

Storage, Pages and TOAST

The durability chain from COMMIT to platter, relations and forks and segments, the 8 KiB page, free space and visibility maps, TOAST, and how to reason about a storage platform without declaring a winner.

6 lessons
  1. 01The durability chain from COMMIT to platterStorage · advanced · ~25 min
  2. 02Relations, forks and segmentsStorage · intermediate · ~25 min
  3. 03Pages and tuplesStorage · advanced · ~30 min
  4. 04The free space map and the visibility mapStorage · intermediate · ~30 min
  5. 05TOAST and large valuesStorage · intermediate · ~30 min
  6. 06Choosing storageStorage · advanced · ~30 min

Part VII

MVCC, Transactions and Visibility

Why PostgreSQL keeps old row versions, what UPDATE really does to a page, transaction IDs and snapshots, isolation levels as PostgreSQL implements them, and long-running transactions as an operational hazard.

6 lessons
  1. 01Why PostgreSQL keeps old row versionsMVCC · intermediate · ~25 min
  2. 02What UPDATE actually does to a pageMVCC · advanced · ~30 minLab
  3. 03Transaction IDs, snapshots and tuple visibilityMVCC · advanced · ~30 min
  4. 04Isolation levels as PostgreSQL implements themMVCC · advanced · ~35 min
  5. 05Long-running transactionsMVCC · intermediate · ~30 min
  6. 06Reading transaction ageMVCC · intermediate · ~25 min

Part VIII

VACUUM, Autovacuum and Wraparound

What VACUUM reclaims and what it does not, autovacuum thresholds and workers, tuning from evidence, the failure modes behind "autovacuum cannot keep up", transaction ID wraparound, bloat measurement, and ANALYZE.

7 lessons
  1. 01What VACUUM doesVacuum · intermediate · ~30 min
  2. 02Autovacuum: launcher, workers and thresholdsVacuum · intermediate · ~30 minLab
  3. 03Tuning autovacuum from evidenceVacuum · advanced · ~35 min
  4. 04When autovacuum cannot keep up: six failure modesVacuum · advanced · ~35 min
  5. 05Transaction ID wraparound and anti-wraparound vacuumVacuum · advanced · ~35 min
  6. 06Measuring bloat honestlyVacuum · advanced · ~30 minLab
  7. 07ANALYZE and planner statisticsVacuum · intermediate · ~30 min

Part IX

Locks, Blocking and Deadlocks

The lock conflict matrix that decides everything, row versus table locks, finding the blocker with pg_locks and pg_blocking_pids, deadlock detection and evidence, the DDL lock queue, and whether killing a session is safe.

6 lessons
  1. 01Lock modes and the conflict matrixLocks · intermediate · ~30 min
  2. 02Row locks versus table locksLocks · advanced · ~30 min
  3. 03Finding the blockerLocks · intermediate · ~30 minLab
  4. 04DeadlocksLocks · intermediate · ~30 minLab
  5. 05DDL and the lock queueLocks · advanced · ~35 min
  6. 06Cancel or terminateLocks · intermediate · ~30 min

Part X

Query Planning, Indexes and Performance Method

How the planner chooses, reading a plan, the safety boundary of EXPLAIN ANALYZE, estimates that go wrong, B-tree maintenance cost, index bloat and REINDEX CONCURRENTLY, and a methodology that starts with evidence.

8 lessons
  1. 01How the planner choosesPlanner · intermediate · ~30 min
  2. 02Reading an EXPLAIN planPlanner · intermediate · ~30 minLab
  3. 03EXPLAIN ANALYZE and its safety boundaryPlanner · intermediate · ~25 min
  4. 04When estimates go wrongPlanner · advanced · ~35 minLab
  5. 05B-tree indexes and what they costPlanner · intermediate · ~30 min
  6. 06Beyond B-tree, where it mattersPlanner · advanced · ~30 min
  7. 07Index maintenancePlanner · intermediate · ~30 min
  8. 08A performance methodologyPlanner · advanced · ~30 min

Part XI

Memory and Resource Management

The shared versus per-backend memory map, shared_buffers against the page cache, the work_mem trap, maintenance_work_mem, temporary file spilling, and Linux memory pressure with cgroups and the OOM killer.

6 lessons
  1. 01PostgreSQL's memory mapMemory · intermediate · ~30 min
  2. 02shared_buffers and the OS page cacheMemory · intermediate · ~30 min
  3. 03The work_mem trapMemory · advanced · ~30 minLab
  4. 04maintenance_work_mem and the operations that use itMemory · intermediate · ~25 min
  5. 05Temporary files and spilling to diskMemory · intermediate · ~25 min
  6. 06Linux memory pressure and the OOM killerMemory · advanced · ~30 min

Part XII

WAL, Checkpoints and Crash Recovery

The write-ahead logging durability contract, segments and LSNs and generation rate, what retains WAL and what releases it, checkpoint cost, crash recovery, and why an immediate shutdown changes what happens next.

7 lessons
  1. 01Write-ahead logging: the durability contractWAL · intermediate · ~30 min
  2. 02WAL segments, LSNs and generation rateWAL · intermediate · ~25 minLab
  3. 03What retains WAL, and what releases itWAL · advanced · ~30 min
  4. 04Checkpoints: what they do and what they costWAL · advanced · ~30 minLab
  5. 05Background writing and the PostgreSQL 18 I/O subsystemWAL · advanced · ~30 min
  6. 06Crash recovery: what "consistent state" meansWAL · intermediate · ~30 min
  7. 07Shutdown modes and their recovery consequencesWAL · intermediate · ~25 min

Part XIII

Backup, Archiving and Point-in-Time Recovery

Backup success is not recovery capability: logical and physical backups and their real limits, WAL archiving and archive integrity, point-in-time recovery performed against a chosen target, and proving a restore rather than reporting one.

8 lessons
  1. 01Backup success is not recovery capabilityBackup · intermediate · ~30 min
  2. 02Logical backups: pg_dump, pg_restore, scope and limitsBackup · intermediate · ~30 minLab
  3. 03Physical backups and the low-level APIBackup · advanced · ~30 min
  4. 04pg_basebackup: its role and its limitsBackup · intermediate · ~35 minLab
  5. 05WAL archiving: archive_command, integrity, retentionBackup · advanced · ~35 minLab
  6. 06Point-in-time recovery, performedBackup · advanced · ~40 minLab
  7. 07Recovery targets and the action taken on reaching oneBackup · advanced · ~30 min
  8. 08Backup tooling, restore testing, and proving recoverabilityBackup · intermediate · ~30 minLab

Part XIV

Replication, Slots and Read Replicas

Streaming replication end to end, WAL sender and receiver, building a standby, the four distinct meanings of replication lag, the synchronous trade-off, replication slots and unbounded WAL retention, and what a read replica asks of the application.

8 lessons
  1. 01Physical streaming replication end to endReplication · intermediate · ~30 min
  2. 02WAL sender and WAL receiverReplication · intermediate · ~25 min
  3. 03Building a standbyReplication · intermediate · ~30 minLab
  4. 04Measuring lag properly: sent, written, flushed, replayedReplication · intermediate · ~30 minLab
  5. 05Synchronous replication and the trade-off it makesReplication · advanced · ~35 min
  6. 06Replication slots and unbounded WAL retentionReplication · advanced · ~30 minLab
  7. 07Replica conflicts and hot_standby_feedbackReplication · advanced · ~35 minLab
  8. 08Read replicas and what the application must acceptReplication · intermediate · ~30 min

Part XV

High Availability, Failover and Disaster Recovery

Why replication alone is not high availability, promotion and timelines, split-brain and fencing, what an HA stack must supply beyond PostgreSQL, client routing, validating a failover, rejoining a former primary, and mapping RPO and RTO to real numbers.

8 lessons
  1. 01Replication is not high availabilityHA · intermediate · ~30 min
  2. 02Promotion, timelines, and what a timeline switch meansHA · advanced · ~30 minLab
  3. 03Split-brain and why fencing is not optionalHA · advanced · ~35 min
  4. 04What an HA stack must supply beyond PostgreSQLHA · intermediate · ~30 min
  5. 05Patroni as one implementation — concepts firstHA · advanced · ~30 min
  6. 06Client routing: DNS, VIP, proxy, service discoveryHA · intermediate · ~30 min
  7. 07Validating a failover, and rejoining a failed primary with pg_rewindHA · advanced · ~35 minLab
  8. 08HA versus backup versus DR; RPO and RTO with real arithmeticHA · intermediate · ~30 min

Part XVI

Observability, Logging and Alerting

Production logging and what statement logging exposes, the statistics views that matter and the ones that changed between releases, wait events, pg_stat_statements, correlating database evidence with the operating system, and alerts worth waking someone for.

7 lessons
  1. 01Production logging configurationObservability · intermediate · ~30 min
  2. 02Log security: what statement logging exposesObservability · intermediate · ~25 min
  3. 03The statistics views that matter, and the ones that changedObservability · intermediate · ~30 min
  4. 04Wait events: what is this backend actually waiting on?Observability · advanced · ~30 min
  5. 05pg_stat_statementsObservability · intermediate · ~30 minLab
  6. 06Correlating PostgreSQL evidence with the operating systemObservability · intermediate · ~30 min
  7. 07Alerting that is actionableObservability · intermediate · ~30 min

Part XVII

Capacity, Maintenance and Upgrades

Planning capacity for far more than the current database size, telling five kinds of disk-full apart, the resource cost of planned maintenance, schema change as an operations problem, minor upgrades, the major upgrade options compared, pg_upgrade, and rehearsal.

8 lessons
  1. 01Capacity planning beyond current database sizeMaintenance · intermediate · ~30 min
  2. 02Disk-full: distinguishing data, WAL, temp, archive and backupMaintenance · advanced · ~35 minLab
  3. 03Planned maintenance and its resource costMaintenance · intermediate · ~30 min
  4. 04DDL and schema change from an operations perspectiveMaintenance · advanced · ~35 min
  5. 05Minor version upgradesMaintenance · foundation · ~25 min
  6. 06Major version upgrade options comparedMaintenance · intermediate · ~30 min
  7. 07pg_upgrade in practiceMaintenance · advanced · ~35 minLab
  8. 08Upgrade rehearsal and post-upgrade validationMaintenance · intermediate · ~30 minLab

Part XVIII

Platforms, Corruption and Production Architecture

What a managed service still leaves you, what a container does not solve for a stateful database, PostgreSQL on Kubernetes and on distributed storage, corruption signals and careful response, checksums, and a defensible reference architecture.

8 lessons
  1. 01Managed versus self-managed: what stays your responsibilityPlatforms · intermediate · ~30 min
  2. 02PostgreSQL in containers: what a container does not solvePlatforms · intermediate · ~30 min
  3. 03PostgreSQL on Kubernetes: operators, StatefulSets, storage, fencingPlatforms · advanced · ~30 min
  4. 04PostgreSQL on distributed storagePlatforms · advanced · ~30 min
  5. 05Data corruption: signals and careful responsePlatforms · advanced · ~35 minLab
  6. 06Checksums, index corruption, and storage failurePlatforms · advanced · ~30 minLab
  7. 07Automating PostgreSQL, and change management for database changePlatforms · intermediate · ~30 min
  8. 08A production reference architecturePlatforms · advanced · ~35 min

Part Labs

Labs

Disposable-container labs covering installation, configuration, authentication and TLS, locking and deadlocks, MVCC and autovacuum, plans and statistics, WAL and checkpoints, backup and point-in-time recovery, replication and promotion, pooling, and a major version upgrade rehearsal.

0 lessons

No lessons published in this part yet. The full curriculum is planned in docs/courses/postgresql/curriculum.md on GitHub.

Part Runbooks

Runbooks

Operational procedures for a database that will not start, connection and authentication failures, blocking sessions and deadlocks, autovacuum and transaction age, disk-full and WAL growth, archive failure, replication lag and failed replicas, safe promotion, backup and restore, point-in-time recovery, upgrades and disaster recovery.

0 lessons

Part Checklists

Checklists

Production readiness reviews for deployment, security hardening, storage, connections and pooling, backup and point-in-time recovery, replication, high availability, monitoring and alerting, capacity, planned maintenance, upgrades, and disaster recovery.

0 lessons

Part Breakfix

Break/Fix Scenarios

Evidence-first diagnosis of startup, access, transaction, vacuum, lock, planner, WAL, archiving, replication, failover, backup, recovery, resource and corruption failures, each reproduced against a real PostgreSQL instance.

0 lessons

Part Capstone

Production Capstone

Build and defend a complete production PostgreSQL architecture: secure deployment, controlled connections, monitored durability, a proven point-in-time recovery, a streaming replica, a validated failover, and twelve injected incidents to survive.

1 lesson
  1. 01Capstone — build, break and defend a production PostgreSQL estateCapstone · expert · ~300 min

Part Final

Final Assessment

Final theory assessment plus a final practical assessment of an inherited estate carrying realistic availability, durability, capacity, performance and security defects.

0 lessons

No lessons published in this part yet. The full curriculum is planned in docs/courses/postgresql/curriculum.md on GitHub.