A database partitioning method and system based on front-end system

Through the library division method based on the pre-system, the transaction pre-system generates a unique flow number and determines the transaction direction, solving the problems of insufficient isolation between database and application and the impact of failure in the existing technology, realizing physical isolation and failover of the database , improves the stability and operation and maintenance efficiency of the system.

CN111930745BActive Publication Date: 2024-12-31SHENZHEN YINSHENG E-PAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010758143.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-12-31
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

Existing library partitioning methods such as Sharding-JDBC and MyCat have insufficient physical isolation between the database and the application, resulting in failures affecting performance and stability, and single-point problems in the proxy layer increase operation and maintenance costs.

Method used

The database distribution method based on the pre-system is adopted to generate a unique flow number through the transaction pre-system, determine the transaction direction, and distribute the request to the transaction system. The distributed primary key and routing system are used for database routing to realize data aggregation and failover.

Benefits of technology

It realizes physical isolation of the database, reduces the scope of failure impact, completes failover, and improves the stability and operation and maintenance efficiency of the system through grayscale verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111930745B_ABST
    Figure CN111930745B_ABST
Patent Text Reader

Abstract

The present invention discloses a database partitioning method and system based on a front-end system, including a merchant system: when a user makes a transaction in the merchant system, the merchant system sends a transaction request to a transaction front-end system; a transaction front-end system: determines the direction of the transaction, and then distributes the request to the transaction system; a transaction system: is used to process the merchant's transaction request and complete the transaction processing; a routing system: is used to do transaction routing, and determines that a transaction goes to a designated transaction system; a distributed primary key system: is used to generate a unique serial number; an operation management system: is used to maintain merchant transactions. This database partitioning method and system based on a front-end system only connects to the database it needs, achieves physical isolation, and reduces the impact range of failures; the database partitioning can also complete the fault transfer function, that is, if a database partition fails, all traffic can be switched to another database to ensure rapid recovery of the system; and grayscale verification can also be performed on the merchant's designated database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of front-end systems, and in particular to a database partitioning method and system based on a front-end system. Background Art

[0002] The current method for database sharding is mainly based on open source middleware, such as Sharding-JDBC and MyCat. Sharding-JDBC's database sharding solution requires the application to be connected to all databases, and does not achieve physical isolation between the database and the application. If one of the databases is down, it may affect the performance and stability of the application; MyCat needs to build a proxy layer, which has a certain amount of network overhead. At the same time, it needs to ensure the stability of the proxy layer, solve the single point problem of the proxy layer, and increase the operation and maintenance costs. Summary of the invention

[0003] In order to overcome the deficiencies of the prior art, the present invention provides a database partitioning method and system based on a front-end system.

[0004] The technical solution adopted by the present invention to solve its technical problem is:

[0005] A database partitioning method based on a front-end system includes:

[0006] S1. The merchant system sends the user's transaction request to the transaction front-end system;

[0007] S2. The transaction front-end system generates a unique transaction serial number;

[0008] S3. The transaction front-end system determines the direction of the transaction;

[0009] S4. The transaction front-end system distributes the transaction request to the transaction system to complete the transaction processing;

[0010] S5. Aggregate the data to meet the query function of the operation management system.

[0011] Furthermore, the step S3 includes step S3.1: taking the modulus of the database quantity using the last digit of the transaction order number.

[0012] Furthermore, the step S3.1 includes step S3.2: the transaction front-end system forwards the request to the transaction system with dubbo group db01, and the transaction is processed by the transaction system.

[0013] Furthermore, the step S3.2 includes a step S3.3: the transaction system saves the routing result to the Oracle database and caches it to MongoDB to facilitate subsequent queries.

[0014] Furthermore, in step S2: the transaction front-end system generates a unique transaction serial number by calling a distributed primary key system.

[0015] Furthermore, in step S3: the transaction front-end system determines the direction of the transaction by calling the routing system.

[0016] Furthermore, in step S5: the data is aggregated using the ogg synchronization function of the database.

[0017] The present invention also discloses a library subsystem based on a front-end system, comprising:

[0018] Merchant system: When a user makes a transaction in the merchant system, the merchant system sends the transaction request to the transaction front-end system;

[0019] Transaction front-end system: determines the direction of the transaction by calling the routing system, and then distributes the request to the transaction system;

[0020] Transaction system: used to process merchant transaction requests and complete transaction processing;

[0021] Routing system: used for transaction routing, determining whether a transaction goes to a specified transaction system;

[0022] Distributed primary key system: used to generate unique serial numbers;

[0023] Operation management system: used for the maintenance of merchant transactions.

[0024] Furthermore, maintenance of merchant transactions includes refund operations.

[0025] The beneficial effects of the present invention include three aspects:

[0026] a. Decoupling: The applications in the distributed database only connect to the databases they need, achieving physical isolation and reducing the impact of failures;

[0027] b. Failure transfer: The sub-databases can also complete the failover function. That is, if a sub-database fails, all traffic can be switched to another database to ensure rapid recovery of the system.

[0028] c. Grayscale: Based on the front-end sub-database, grayscale verification can also be performed on the merchant's designated database. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0030] Figure 1 It is a structural schematic diagram of a sub-library system based on a front-end system of the present invention;

[0031] Figure 2It is another structural schematic diagram of a sub-library system based on a front-end system of the present invention. DETAILED DESCRIPTION

[0032] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.

[0033] The present invention discloses a database partitioning method based on a front-end system, comprising:

[0034] S1. The merchant system sends the user's transaction request to the transaction front-end system;

[0035] S2. The transaction front-end system generates a unique transaction serial number by calling the distributed primary key system;

[0036] S3. The transaction front-end system determines the direction of the transaction by calling the routing system;

[0037] S3.1: Use the last digit of the transaction order number to modulo the database quantity;

[0038] S3.2: The transaction front-end system forwards the request to the transaction system in dubbo group db01, and the transaction is processed by the transaction system;

[0039] S3.3: The transaction system saves the routing results to the Oracle database and caches them to MongoDB for subsequent queries.

[0040] S4. The transaction front-end system distributes the transaction request to the transaction system to complete the transaction processing;

[0041] S5. Use the ogg synchronization function of the database to aggregate the data to meet the query function of the operation management system.

[0042] The present invention also discloses a library subsystem based on a front-end system, comprising:

[0043] Merchant system: When a user makes a transaction in the merchant system, the merchant system sends the transaction request to the transaction front-end system;

[0044] Transaction front-end system: determines the direction of the transaction by calling the routing system, and then distributes the request to the transaction system;

[0045] Transaction system: used to process merchant transaction requests and complete transaction processing;

[0046] Routing system: used for transaction routing, determining whether a transaction goes to a specified transaction system;

[0047] Distributed primary key system: used to generate unique serial numbers;

[0048] Operation management system: used for the maintenance of merchant transactions, such as refund operations.

[0049] The beneficial effects of the present invention include three aspects:

[0050] A. Decoupling: The applications in the distributed database only connect to the databases they need, achieving physical isolation and reducing the impact of failures.

[0051] B. Failure transfer: The sub-databases can also complete the failover function. That is, if a sub-database fails, all traffic can be switched to another database to ensure rapid recovery of the system.

[0052] C. Grayscale: Based on the front-end sub-database, grayscale verification can also be performed on the merchant's designated database.

[0053] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A database partitioning method based on a front-end system, characterized in that: include: S1. The merchant system sends the user's transaction request to the transaction front-end system; S2. The transaction front-end system generates a unique transaction serial number; In step S2: the transaction front-end system generates a unique transaction serial number by calling the distributed primary key system; S3. The transaction front-end system determines the direction of the transaction; The step S3 includes step S3.1: taking the modulus of the database quantity using the last digit of the transaction order number; The step S3.1 includes step S3.2: the transaction front-end system forwards the request to the transaction system of the dubbo group db01, and the transaction is processed by the transaction system; The step S3.2 includes step S3.3: the transaction system saves the routing result to the Oracle database and caches it to MongoDB to facilitate subsequent queries; In step S3: the transaction front-end system determines the direction of the transaction by calling the routing system; S4. The transaction front-end system distributes the transaction request to the transaction system to complete the transaction processing; S5. Aggregate the data to meet the query function of the operation management system; In the step S5: the data is aggregated using the ogg synchronization function of the database.

2. A sub-library system based on a front-end system, characterized in that: The system is used to implement a database partitioning method based on a front-end system as claimed in claim 1, comprising: Merchant system: When a user makes a transaction in the merchant system, the merchant system sends the transaction request to the transaction front-end system; Transaction front-end system: determines the direction of the transaction by calling the routing system, and then distributes the request to the transaction system; Transaction system: used to process merchant transaction requests and complete transaction processing; Routing system: used for transaction routing, determining whether a transaction goes to a specified transaction system; Distributed primary key system: used to generate unique serial numbers; Operation management system: used for the maintenance of merchant transactions.

3. According to claim 2, a sub-library system based on a front-end system is characterized in that: Maintenance of merchant transactions includes refund operations.