TCC-TRANSACTION is an open-source solution for TCC-style (Try-Confirm-Cancel) distributed transactions in microservice architectures. It ensures high performance and eventual consistency across multiple services and databases using a three-phase approach:
- Try: Executes the business logic, performs all necessary consistency checks, and reserves the required business resources (providing quasi-isolation).
- Confirm: Executes the business logic using the resources reserved during the Try phase. It performs no additional business checks and must be idempotent.
- Cancel: Releases the business resources reserved during the Try phase. This operation must also be idempotent.
If all Try operations succeed, the system proceeds to the Confirm phase. If any Try operation fails, the system proceeds to the Cancel phase to roll back the reserved resources.