Unlock instant, AI-driven research and patent intelligence for your innovation.

Microservice transaction submitting method based on single database

A transaction submission and microservice technology, applied in the field of microservice transaction submission, can solve problems such as ensuring eventual consistency cannot meet business requirements, affecting availability, and large performance loss, achieving efficient SQL aggregation and submission operations, ensuring acid characteristics, The effect of mitigating the impact of performance

Active Publication Date: 2019-07-12
CASICLOUD-TECH CO LTD
View PDF6 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. Microservices are closely connected and may even be deployed on the same server in proportion
[0005] 2. The database operations required by the same API for microservices are similar (for example, both execute two SQL,
[0008] 4. The microservice business cannot use the final consistency guarantee (see subsequent description)
[0025] Two-phase commit: The main problem with two-phase commit is that during the first distributed commit, the transaction initiator needs to wait for all sub-transaction providers to successfully submit "preprocessing" before sending a commit request to the database. A one-step synchronous submission work, resulting in a very large performance loss and affecting availability
[0026] Ensure final consistency: The problem with ensuring final consistency is that although final consistency can meet most business requirements, there are still a small number of requirements that must implement the acid feature, so ensuring final consistency cannot meet all business requirements

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
  • Microservice transaction submitting method based on single database
  • Microservice transaction submitting method based on single database
  • Microservice transaction submitting method based on single database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0047] The present invention will be described in further detail below in conjunction with the accompanying drawings.

[0048] The present invention is described below through preferred embodiments, however, the present invention is not limited to the embodiments described here, and includes various changes and changes made without departing from the scope of the present invention.

[0049] The idea of ​​the present invention is that, in actual web applications, many database operation steps involved in requests are fixed, so the caching mechanism can be fully utilized, so that when the same API call is encountered later, there is no need to perform Two-phase commit, but a counting mechanism for counting commits.

[0050] figure 1 , indicating the overall architecture of a microservice system, where the arrows indicate the data flow direction, and the external performance of the entire system is: receiving external requests, executing data services (executing sql, etc.), and re...

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 micro-service transaction submitting method based on a single database. The method comprises the following steps that: an external api gateway downloads a plurality of micro-services layer by layer; and the sql gateway distributes a transaction sql cache space for the transaction id, and all sql requests received by the sql gateway are stored in the transaction sql cachespace. The external api gateway executes the request for the first time, and 1, the external api gateway calculates the sql submission number sent by the transaction id and stores the sql submission number in the request type cache space; 2, the external api gateway sends a request for opening a transaction id to the sql gateway, and the sql submission number is stored in a transaction sql cache space; and when the sql gateway receives the sql request or opens the transaction id request, the sql gateway judges whether the number of the received sql reaches the submitting number, and if so, thesql gateway uniformly submits the sql. And when the same request is executed again later, only the step 2 is executed. According to the method, the strong consistency of multiple micro-service transactions can be ensured, and excessive sacrifice is not needed in performance.

Description

technical field [0001] The invention belongs to the field of ensuring consistency of microservice transactions, and in particular relates to a method for submitting microservice transactions to the same database. Background technique [0002] With the rapid development of microservice technology, more and more microservice applications support a large number of businesses, some of which need to ensure strong consistency of transactions, such as the payment and points system of an e-commerce website, when users make payments After the operation, it is necessary to deduct the user's payment and modify the points at the same time. These two operations are inseparable. It is not allowed that one succeeds and the other fails, which constitutes a transaction. [0003] The invention relates to the problem of database merging transaction of two or more microservices with close connection and frequent requests. The general characteristics of these microservices are: [0004] 1. Mic...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/25G06F16/242G06Q20/08
CPCG06Q20/085G06F16/244G06F16/252
Inventor 金博玉王文宣刘蜀东朱玥何继文刘辉军舒刚杨硕邱桂苹陈群李利民孙宏伟汪智奇胡步军蒋文韬
Owner CASICLOUD-TECH CO LTD