Where Does My INSERT Go? A Logical Replication Story
summary
Follows one INSERT from executor to subscriber, showing WAL construction, why wal_level=logical adds column and relation metadata, and how ReorderBuffer groups interleaved WAL by XID and LSN to emit ordered changes. Covers WAL sender, logical decoding, replication slots that retain required WAL, output plugins (pgoutput, wal2json/test_decoding) and the apply worker that replays changes and updates confirm_flush_lsn. Notes large transactions can spill reorder buffer to disk and full-page-image writes for crash safety.
AI-written summary · about
chapters (12)
- 0:00Music & introduction
- 0:41Roadmap: end-to-end replication flow
- 1:53From SQL insert to heap tuple
- 4:00Writing data into shared buffers
- 5:23WAL creation and durability explained
- 7:06Inside a WAL record and crash safety
- 9:02Logical vs physical replication differences
- 11:27WAL sender and logical decoding layer
- 14:07Reordering transactions with reorderbuffer
- 20:14The commit triggers decoding and plugins
- 24:18Applying changes on the subscriber
- 25:11End-to-end journey recap
related talks
29mLogical replication theory and concepts
54mUnderstanding Logical Decoding and Replication
56mLogical Replication of DDLs
59mLogical Replication...LIVE!
27m"Write Once Stream Everywhere: Transforming Your Data into Events"
39mLogical Replication handling of large transactions
22mHazards of logical decoding in PostgreSQL
38mA journey into postgresql logical replication
