PostgreSQL: Modeling, Performance and Recovery

A laboratory-led course in PostgreSQL engineering - from schema design to point-in-time recovery.

Taught by Noshad Alam 7 lessons 41 min Published 30 Nov 2026

PostgreSQL is the default answer for a relational workload, and it has earned that position by being unusually complete. It is a strict, standards-respecting SQL engine with transactional DDL, a mature cost-based planner, and an extension mechanism so capable that geospatial indexing, time-series partitioning and vector search all arrive as extensions rather than forks.

Overview

This course treats PostgreSQL as an engineering subject rather than a syntax reference. You will design competing schemas and argue for one, reason about what MVCC does to a concurrent workload, read an `EXPLAIN ANALYZE` plan and act on it, lose a database on purpose and get it back with a measured recovery point, and write down the security and cost decisions a production deployment actually requires.

Seven modules, about 100 hours including laboratory work. Every module carries a worked example in SQL and a laboratory exercise with a defined deliverable. The final module is a capstone - a banking ledger with double-entry invariants, concurrent transfers and point-in-time recovery - assessed on correctness under concurrency, measured performance against a declared baseline, and a defensible account of the failure modes.

Introduction

This course assumes the shared foundations of the programme: data modeling, the vocabulary of ACID and isolation, basic command line and Docker, one programming language, and the habit of writing automated tests. It also assumes introductory SQL - you should be able to write a `SELECT` with a join before Module 2, because Module 2 moves quickly through CTEs and window functions on the way to something harder.

You will need a PostgreSQL 16 or newer instance you are free to break. Docker is the least painful route: a container you can destroy and recreate is worth more in this course than a carefully installed server you are reluctant to damage, because several laboratories require you to damage it.

A note on how to read the modules. Each one states what it covers, works one example in full, and then sets a laboratory with a deliverable. The laboratory is the assessment - the reading is preparation for it. Submitting a laboratory means submitting something reproducible: setup instructions somebody else can follow, the schema, the queries, and the tests that show it behaves as claimed.

What you will be able to do

  • Provision a PostgreSQL instance and document its configuration reproducibly
  • Choose between competing schema designs and defend the choice against stated access patterns
  • Use PostgreSQL's type system deliberately, including arrays, JSONB and ranges
  • Explain what MVCC does to readers, writers and table size, and detect bloat
  • Reason about isolation levels, lock contention and deadlocks in a concurrent service
  • Read EXPLAIN ANALYZE and decide whether the planner's estimate or your index is the problem
  • Choose between B-tree, GIN, GiST, BRIN and partial indexes for a stated query
  • Perform and verify a point-in-time recovery, and state the achieved RPO and RTO
  • Configure streaming and logical replication, and plan a failover
  • Implement least privilege with roles, grants and row-level security
  • Produce a deployment checklist covering TLS, monitoring, partitioning and upgrades

What each level covers

5 levels · 7 lessons

  1. Beginner - Foundations

    Getting a server you can break, and the type system and schema design that everything later depends on.

    2 lessons 13 min of reading

    Start with Environment and Fundamentals →
  2. Intermediate - Application Behaviour

    What concurrency actually does to your data, and the server-side programming that belongs in the database rather than above it.

    1 lesson 3 min of reading

    Start with MVCC, Isolation and Server-Side Logic →
  3. Advanced - Performance and Reliability

    Making it fast on evidence rather than instinct, and getting the data back after you have lost it.

    2 lessons 13 min of reading

    Start with Performance Engineering →
  4. Expert - Security and Production Architecture

    Least privilege that actually holds, and the operational decisions that make a deployment defensible.

    1 lesson 7 min of reading

    Start with Security, Partitioning and Upgrades →
  5. Capstone

    One system, built and defended: correctness under concurrency, measured performance, and a recovery you have actually performed.

    1 lesson 5 min of reading

    Start with Capstone - A Banking Ledger →

Guides and articles

Longer reading about this subject, written alongside the course.

Course guide How to work through this course The order the modules build in, how the laboratories are assessed, and the habits that make the difference between finishing and understanding. 2 min read

Before you start

  • PostgreSQL 16 or newer, in a disposable environment
  • Docker, or a local installation you are willing to destroy
  • psql, and optionally pgAdmin or DBeaver
  • One programming language with a PostgreSQL driver
  • Introductory SQL before Module 2
  • The programme's shared foundations

Common questions

What does the PostgreSQL: Modeling, Performance and Recovery course cover?
It is 5 levels and 7 lessons: Beginner - Foundations; Intermediate - Application Behaviour; Advanced - Performance and Reliability; Expert - Security and Production Architecture; Capstone. Each level ends with a quiz, and the last one is an exam over the whole course.
How long does it take?
About 41 minutes of reading and exercises - roughly 0.7 hours. It is self-paced with no cohort and no start date, so you can leave and come back and the site remembers where you were.
What do I need to know first?
PostgreSQL 16 or newer, in a disposable environment. Docker, or a local installation you are willing to destroy. psql, and optionally pgAdmin or DBeaver. One programming language with a PostgreSQL driver. Introductory SQL before Module 2. The programme's shared foundations.
Is it free?
Yes. Every lesson, example and quiz in this course is free to read, and you do not need an account to read them. Signing in only adds progress tracking and quiz results.
What will I be able to do afterwards?
Provision a PostgreSQL instance and document its configuration reproducibly. Choose between competing schema designs and defend the choice against stated access patterns. Use PostgreSQL's type system deliberately, including arrays, JSONB and ranges. Explain what MVCC does to readers, writers and table size, and detect bloat. Reason about isolation levels, lock contention and deadlocks in a concurrent service. Read EXPLAIN ANALYZE and decide whether the planner's estimate or your index is the problem. Choose between B-tree, GIN, GiST, BRIN and partial indexes for a stated query. Perform and verify a point-in-time recovery, and state the achieved RPO and RTO. Configure streaming and logical replication, and plan a failover. Implement least privilege with roles, grants and row-level security. Produce a deployment checklist covering TLS, monitoring, partitioning and upgrades.