Manager and management method for distributed transaction under microservice architecture

A distributed transaction and management method technology, applied in the field of distributed transaction manager and management, can solve the problems of resource waste, performance loss, business logic implementation inconvenience, etc., to achieve the effect of convenient use, avoiding resource waste and performance loss

Active Publication Date: 2018-07-20
SHENZHEN COMTOP INFORMATION TECH
View PDF4 Cites 16 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In the transaction manager based on the TCC compensation mechanism in the industry, there is g

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Manager and management method for distributed transaction under microservice architecture
  • Manager and management method for distributed transaction under microservice architecture

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] refer to figure 1 , Embodiment 1 discloses a distributed transaction manager under a microservice architecture. The transaction manager in this embodiment can integrate Springcloud and Dubbo microservice frameworks to provide distributed transaction management for application development in a cloud environment.

[0030] Specifically, the transaction manager in this embodiment includes a remote interceptor, a service interceptor, and a cache. The remote interceptor is started every time the service is called remotely, and the intercepted information is stored in the cache. The business interceptor starts once each time the service is called, and stores the intercepted information in the cache. The cache can use cache databases such as redis, memcached, or mongodb.

[0031] First, when the business activity starts, the transaction manager intercepts it with its internal business interceptor, generates a transaction context, and stores it in the cache. Transaction conte...

Embodiment 2

[0036] refer to figure 2 , the transaction management method provided by the embodiment mainly includes:

[0037] S100. When a business activity starts, use a business interceptor to intercept, generate a transaction context, and store it in a cache.

[0038] The cache can use cache databases such as redis, memcached, or mongodb. Transaction context includes global transaction id, JVM identifier, persistent historical data status, current transaction status, etc.

[0039] S200. Determine the type of the called service according to the type of the service calling method. If the called service is the main service, create a transaction, use the action of calling the main service as the root of the service call tree, update the transaction context in the cache, and perform the main service When a business exception occurs, the business logic is invoked to perform transaction compensation according to the historical state in the transaction context, and submit the transaction. I...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a manager and a management method for a distributed transaction under microservice architecture. The method comprises the following steps that: according to a service calling method type, judging the type of called service; if the called service is slave service which needs to be remotely called, obtaining a transaction context from cache, and identifying a JVM (Java Virtual Machine) environment; if the slave service and master service are positioned in the same VM, carrying out local calling, executing preprocessing, saving a compensation operation, updating the transaction context, and executing the slave service; and when business is abnormal, according to the transaction context, carrying out transaction compensation. The implementation of the manager and the management method for the distributed transaction under the microservice architecture has the following beneficial effects: the transaction context can be obtained from the cache, the JVM environment isidentified, the same JVM environment can be called through local calling so as to bring convenience to business development personnel in use, the business development personnel do not need to distinguish local calling and remote calling, and unnecessary resource waste and performance loss can be avoided.

Description

technical field [0001] The invention relates to the field of cloud computing, in particular to a distributed transaction manager and a management method under a microservice architecture. Background technique [0002] The popularity of cloud-native and microservice architectures has made distributed transaction issues increasingly prominent. Cloud-native and microservice architectures are essentially distributed service-oriented architectures. Popular microservice frameworks include SpringCloud and Dubbo. Whether it is Springcloud or Dubbo, distributed transactions are an unavoidable challenge. Transactions are divided into flexible transactions and rigid transactions. Rigid transactions refer to transactions that strictly follow the ACID principle, such as database transactions in a stand-alone environment. Flexible transactions refer to transactions that follow the BASE theory. They are usually used in distributed environments. Common implementation methods include: two-p...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/54G06F9/455
CPCG06F9/45558G06F9/547
Inventor 林圳杰缪柏年易文峰
Owner SHENZHEN COMTOP INFORMATION TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products