Coordinate a payment and inventory update across two separate services so both succeed or both roll back together.
Replace ad-hoc error handling in microservice workflows with a reliable, rollback-safe transaction pattern.
Add distributed transaction support to a Spring-based microservice application without a full saga framework.
Repository README is brief and in Chinese, the linked wiki is required reading before setup.
tcc-transaction is a Java library that implements the TCC pattern for handling transactions across multiple separate services or databases. TCC stands for Try, Confirm, and Cancel, which are the three phases a transaction goes through. In the Try phase, the system checks that all the business conditions are met and reserves the required resources without actually completing anything. This is like placing a hold on inventory or funds rather than spending them. In the Confirm phase, the system uses only those pre-reserved resources to complete the actual operation. If something goes wrong and the transaction cannot proceed, the Cancel phase releases whatever was reserved during Try, leaving the system in its original state. This pattern exists to solve a specific problem in distributed systems, where a single business operation touches multiple independent services that each manage their own data. Standard database transactions cannot span multiple services, so without a coordination pattern like TCC, a failure partway through can leave some services updated and others not, creating inconsistent data. TCC allows an application to coordinate these services in a way that either all steps complete or all are rolled back cleanly. The README, written in Chinese, is brief and describes only the three-phase structure. It links to a quick-start guide on the project wiki for setup instructions. The project targets Java developers building distributed or microservice applications who need reliable multi-service transaction coordination. Given the sparse documentation in the repository itself, following the linked wiki would be the first step for anyone looking to use or evaluate this library.
← changmingxie on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.