PostgreSQL
A relational database that keeps your data correct under pressure.
PostgreSQL is a relational database server: it stores data in typed tables, enforces the rules you declare on every write, and answers questions about that data through SQL. It is not merely a place SQL happens to run — every constraint you declare is checked on every write, which is what keeps the data trustworthy as more of it accumulates.
- Difficulty
- intermediate
- Time
- 15+ hours
- Sections written
- 22
Why it matters
- It is the default system of record for data that must stay correct — orders, accounts, inventory — because it enforces constraints rather than trusting the application to.
- MVCC lets readers and writers work concurrently without blocking each other for most workloads, which most other relational databases approximate less cleanly.
- A single server can be the backbone for transactional data, JSON documents (JSONB), full-text search and analytics queries — before reaching for a specialized system.
- Django and FastAPI both commonly sit on top of PostgreSQL, so the concepts here carry straight into two of the other topics here.
Where it is used
- Systems of record — orders, accounts, inventory, anywhere correctness cannot be optional
- Backends built on Django or FastAPI, both of which default to it
- Multi-tenant SaaS, using schemas or row-level security for isolation
- Analytics and reporting, via window functions, CTEs and materialized views
The big picture
- SQL — queries, joins, CTEs
- leads to Storage (writes become row versions)
- Storage — MVCC, WAL, vacuum
- leads to Concurrency (MVCC makes possible)
- Concurrency — locks, isolation, transactions
- leads to Performance (the planner reasons about)
- Performance — indexes, the planner
- leads to Operations (is kept healthy by)
- Operations — backup, replication, monitoring

