Country Garden Flourishing life platform strong consistent distributed transaction, is based on the two-stage submission + local transaction compensation mechanism to achieve. The principle is introduced
Based on the Java language to develop (JDK1.8), support Dubbo, SpringCloud for distributed transactions.
Git config core.longpaths true git config core.longpaths true git config core.longpaths true
-
The framework characteristics
-
Support dubbo, SpringCloud and other RPC frameworks for distributed transactions.
-
Transaction initiator, participant and coordinator communicate stably and efficiently based on Netty long connection.
-
The coordinator uses Eureka as the registry and supports the cluster mode.
-
Use Aspect AOP Aspect thought to seamlessly integrate with Spring.
-
Simple configuration, simple integration, simple source code, high stability, has been used in the production environment.
-
Built-in classic distributed transaction scenario demo project, and swagger- UI visual interface can be quickly experienced.
-
-
Transaction role
-
The transaction originator (which can be understood as consumers such as dubbo consumers and SpringCloud callers) initiates a distributed transaction
-
Transaction participants (understood as providers such as dubbo’s provider, SpringCloud’s REST service provider) participate in the transaction initiator’s transaction
-
Transaction Coordinator (TX-Manager), coordinates the commit of distributed transactions, rollback, etc.
-
Technical solution
-
The Coordinator (TX-Manager) uses Eureka as the registry, cluster configuration, to achieve high availability of services, uses Redis cluster to distributed storage of transaction data, Springboot provides REST services, uses NetTY to communicate with participants and initiators for long connection.
-
Initiator and coordinator, using Aspect AOP cutting ideas, SPI, multithreading, asynchronous callback, thread pool, NetTY communication and other technologies.
-
-
SPI extension
- Local transaction recovery, support redis, MogonDB, ZooKeeper, file, mysql and other relational databases
- Local transaction serialization save, support Java, Hessian, Kryo, Protostuff
- Netty communication serialization mode, support Hessian, Kryo, Protostuff