NOTE
2.10 Two-Phase Implementation: TCC
TCC divides an application-level transaction into two phases: Try checks the business operation and reserves resources, followed by Confirm or Cancel according to the result.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Is TCC?
- 2PC is a two-phase approach at the database layer, while TCC is a two-phase approach at the application layer.
- TCC:
- Try: attempt to execute the transaction.
- Confirm: confirm execution of the transaction.
- Cancel: cancel execution of the transaction.
- In essence, it is also a two-phase transaction.
- In the first phase, execute Try to perform business checks and reserve resources.
- The second phase depends on the result of the first phase. If successful, execute Confirm to confirm the business operation; if it fails, execute Cancel to perform the opposite of Try, similar to an explicitly implemented rollback.

2. Why Is TCC Needed?
- TCC solves several shortcomings of 2PC:
- Single point of failure: multiple business activity managers are used.
- Synchronous blocking: commit directly during Try, without needing to block and wait; Cancel…
3. Problems with TCC
- Application code changes: developers must implement Try, Confirm, and Cancel themselves.
4. Implementation
4.1. Seata
5. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub