1. Typical scenarios of distributed transaction applications
1.1. Multi-service
With the rapid development of the Internet, service architecture models such as microservices and SOA are being used on a large scale, and many distributed transaction problems will arise as follows:
1.2. Multiple data sources
1.2.1, Cross-library
Cross-library transaction means that an application needs to operate multiple libraries for a certain function, as shown in the figure below:
1.2.2. Sub-database and sub-table
Usually, if a database has a large amount of data or is expected to have a large amount of data in the future, it will be split horizontally, that is, it will be divided into databases and tables. As shown in the figure below, the order database is split into 4 libraries: