TCC: Try, Confirm, Cancel - Junior¶
TCC reserves resources before making the final decision.
flowchart LR
Try[Try: reserve stock and funds] --> Decision{All reserved?}
Decision -->|yes| Confirm
Decision -->|no| Cancel
Try must not finalize the business action. Confirm consumes the reservation; Cancel releases it. Network retries mean both phase-two operations must be idempotent.
Test yourself¶
- What does Try reserve?
- Why can Confirm repeat?
- How is TCC different from a Saga compensation?
Continue to middle.md.