Implementing Strict Serializability with pg_xact
summary
Shows a practical way to get Strict Serializability from Postgres by using pg_xact metadata functions to record server-assigned transaction IDs and snapshots, synthesizing those snapshots so each app transaction is visible in a total order, and ordering change feeds by WAL commit timestamps (requires commit timestamp enabled). The implementation runs at large Azure/Postgres scale and replaces a slow custom-MVCC approach, but has tradeoffs: xid counter restoration needs a loop to advance IDs and frequent garbage collection (vacuum) is required to avoid xid overflow.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 2:58Consistency 101
- 9:59Strict Serializability
- 11:43Who needs Strict Serializability
- 15:08Naive Approach
- 17:22pg_xact approach
- 23:09What's the catch?
- 26:15Thanks
related talks
49mConcurrency Deep-Dive
51mHigh-concurrency distributed snapshots
35mUnderstanding and Optimizing commit sychronization for maximum performance
50mExplaining the PG concurrency control mechanisms using rollercoasters
45mMultiXacts in PostgreSQL: usage, side effects, and monitoring
45mTransactions and Concurrency Control Patterns
28mUnderstanding Transaction Isolation for App Developers
41mConcurrency, Scalability and Transactions -- Myths and Surprises
