Two-Phase Commit

3 levkk 2 9/10/2025, 5:35:06 PM docs.pgdog.dev ↗

Comments (2)

BinaryIgor · 3h ago
Usually there are not worth the complexity:

"Two-phase commit provides an eventual consistency guarantee only. While the transaction is committed, even if no errors occur, other clients will be able to see partial updates to the database cluster."

Plus, I wonder whether they have resilient mechanism to not hold transactions in the prepared state for too long, in case of crashes. In most cases, you can redesign your app/system to no require such complex things

levkk · 2h ago
It's good to have some guarantee that a write is atomic and won't be left in a half-written state. I think that's strictly worse even if it's only "eventually" consistent. "Eventual" means within a couple milliseconds, really.

> you can redesign your app/system

You generally don't want to do that if you can avoid it. Also, easy to make a mistake there while 2pc is pretty deterministic.