Logo
Distributed Transaction

Background #

ShardingSphere provides three modes for distributed transactions LOCAL, XA, BASE.

Parameters #

rules:
  - !TRANSACTION
    defaultType: # Transaction mode, optional value LOCAL/XA/BASE
    providerType: # Specific implementation of the mode

Procedure #

Use LOCAL Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - !TRANSACTION
    defaultType: LOCAL

Use XA Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - !TRANSACTION
    defaultType: XA
    providerType: Narayana/Atomikos 

Instruction

SphereEx-DBPlusEngine comes with Narayana dependencies built in and can be configured directly

Use BASE Mode #

The content of the server.yaml configuration file is as follows:

rules:
  - !TRANSACTION
    defaultType: BASE
    providerType: Seata 

Build a Seata Server, add relevant configuration files and Seata dependencies, see ShardingSphere Integrates Seata Flexible Transactions