Postgres 19 introduces smarter read replicas ๐๐
alex shapalov
Visit on X@alxshp4.1K followers
15,352 views
Postgres 19 introduces smarter read replicas ๐๐
You hit Save. โ
You refresh. ๐
Your old data is back. ๐
Your write committed.
Your replica was still catching up.
โ๏ธ Write to the primary.
โ
Commit the transaction.
๐ Capture the primaryโs WAL position after the commit.
โณ Run WAIT FOR LSN on the replica with that position.
๐ Once the wait succeeds, read from that same replica.
With the new WAIT FOR LSN command, your app can tell an async replica how far to catch up before running the read.
Read your own writes on an async replica. ๐
Comments
Comments from the original post on X (Twitter)
No comments yet
