Senior Track Roadmap

Database: logical replication

Logical replication in Postgres decodes the write-ahead log into row changes instead of replaying bytes. The course compares it with physical replication, then covers publications, subscriptions and replication slots. It explains the wal_level setting, the restart needed to change it and its permanent WAL cost. It shows how replica identity lets updates and deletes find the right row. It looks at where logical replication fits, such as major version upgrades, and where a batch export or a cache is simpler. It ends with stopped subscribers, full disks, schema drift and conflicts.

What you'll learn

  • ✓How physical and logical replication differ in what they copy and allow
  • ✓How publications, subscriptions and replication slots work together
  • ✓What wal_level must be set to, and what changing it costs
  • ✓How replica identity identifies rows for updates and deletes
  • ✓Where logical replication fits, such as major version upgrades
  • ✓How it fails: stopped subscribers, full disks, schema drift and conflicts
Free preview · Lesson 1 3 min read

Physical versus logical

The senior course "Database architecture: replicas" described physical replication. Logical replication is a different mechanism with a different purpose, and the difference is the whole subject.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...