# Two-phase commit provides atomicity but can leave participants blocked and reduce transaction availability

DevFeed: [Two-phase commit provides atomicity but can leave participants blocked and reduce transaction availability](<https://devfeed.tech/articles/two-phase-commit-is-not-dead-it-is-just-expensive-and-you-should-know-the-price-89928.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/67-two-phase-commit-is-expensive-not-dead/>)

Author: hello@ankit-rana.com

Published: 2026-10-19T00:00:00Z

Content type: article

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [scalable-architecture](<https://devfeed.tech/topics/scalable-architecture.md>), [self-hosted databases vs managed services](<https://devfeed.tech/topics/self-hosted-databases-vs-managed-services.md>), [CAP theorem](<https://devfeed.tech/topics/cap-theorem.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [synchronization](<https://devfeed.tech/topics/synchronization.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [database](<https://devfeed.tech/tags/database.md>), [databases](<https://devfeed.tech/tags/databases.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [distributed](<https://devfeed.tech/tags/distributed.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [distributed-transaction](<https://devfeed.tech/tags/distributed-transaction.md>), [distributed-transactions](<https://devfeed.tech/tags/distributed-transactions.md>), [fsync](<https://devfeed.tech/tags/fsync.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [latency](<https://devfeed.tech/tags/latency.md>), [locks](<https://devfeed.tech/tags/locks.md>), [two-phase-commit](<https://devfeed.tech/tags/two-phase-commit.md>)

## AI overview

Two-phase commit (2PC) provides atomicity across resource managers by requiring participants to hold locks after voting until a coordinator decides. If the coordinator fails during that interval, participants can remain blocked. The article explains how adding participants lowers transaction availability, contrasts 2PC with the transactional outbox pattern, and identifies cases where 2PC may still be appropriate.

## Source excerpt

Two-phase commit gives real atomicity across independent resource managers, and it pays for it by making every participant hold locks from the moment it votes until the coordinator tells it what to do. If the coordinator dies in that window, participants are stuck holding locks with no legal way to proceed, because they promised they could commit and cannot take it back. Availability is the product of every participant's availability, so adding services makes the transaction less likely to complete rather than more.