1.3 About the Distributed Transaction Protocols
MicroTx supports the following distributed transaction protocols:
- XA protocol, which is based upon The Open Group’s XA specification. For details about the specification, see https://pubs.opengroup.org/onlinepubs/009680699/toc.pdf.
- Saga protocol, which is based on the Eclipse MicroProfile LRA specification. For details about the specification, see https://download.eclipse.org/microprofile/microprofile-lra-1.0-M1/microprofile-lra-spec.html.
- Try-Confirm/Cancel (TCC) protocol
Use XA when strong consistency is required, similar to consistency provided by the local database transactions, where all the ACID properties of a transaction are present. For example, financial applications. Use the Saga protocol for transactions that may take a long time to complete. You can use the Saga protocol to mitigate locking issues. The TCC protocol fits well for applications that use a reservation model, such as airline seats or hotel rooms. Both Saga and TCC support long running transactions. Saga is far more general, but requires application specific actions for both completing a successful Saga and compensating a failed Saga. Whereas, compensation in TCC is performed by deleting the reservation, and then returning whatever was reserved to the pool of available resources.
- XA Transaction Protocol
An application using XA, must demarcate the transactions boundaries. MicroTx commits or rolls back the transaction. - Saga Transaction Protocol
- Try-Confirm/Cancel Transaction Protocol
The Try-Confirm/Cancel (TCC) transaction protocol holds some resources in a reserved state until the transaction is either confirmed or canceled. If the transaction is canceled, the reserved resources are released and are available in the inventory.
Parent topic: About MicroTx