Transaction processing method and system
By using metadata cluster to manage metadata in the cloud native database system, the decoupling of metadata and computing cluster is solved, and the data operation accuracy and transaction processing capabilities of cloud native database system after metadata separation is solved, and computing is realized The layer's efficient expansion and unified transaction processing supports multiple transaction isolation levels, improving system performance and reliability.
Patent Information
- Application Number
- CN202311705537.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-26
- Filing Date
- 2023-12-12
- Publication Date
- 2024-12-27
AI Technical Summary
After the cloud native database system separates the metadata information, how to ensure the correctness of data operations and unified transaction processing capabilities has become a difficult point, especially in the process of scaling and scaling of the computing layer.
A separate metadata cluster is used to manage metadata to realize the decoupling of metadata and computing clusters, making the computing layer simpler and more efficient when expanding nodes, and at the same time, ensuring that the database system presents unified transaction processing capabilities to the outside. Specific methods include coordinating points receiving and processing transaction requests, distributing data and metadata operations to the computing cluster and metadata cluster, and coordinating and notifying them before and after transaction submission to ensure the freshness and consistency of data.
It realizes the efficiency of computing layer node expansion and unified transaction processing capabilities of the database system to the outside world, reduces data reading and sending, supports two transaction isolation levels of RC and RR, and optimizes query and pruning through metadata operations. Improves system performance and reliability.
Smart Images

Figure CN119201362A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 26, 2023, with application number 202310760061.7 and invention name “A transaction processing method, system and computing device cluster”, all contents of which are incorporated by reference in this application. Technical Field
[0002] The present application relates to the field of cloud computing technology, and in particular to a transaction processing method, system and computing device cluster, computer-readable storage medium, and computer program product. Background Art
[0003] Big data is increasingly being used in enterprises, and databases, as a carrier for big data storage and analysis, have a huge market. Among them, cloud-native databases provide data storage services based on cloud infrastructure, and have higher cost-effectiveness and performance advantages than local databases, and are gradually becoming the first choice for major enterprises.
[0004] Cloud native database systems mostly use a storage-computing separation architecture, where the metadata information of the data is bound to the computing nodes. In order to improve the elastic expansion capability of the computing layer, separating the metadata information of the data stored on the computing nodes has become a research hotspot for cloud vendors. However, after separating the metadata information, it becomes difficult for the database system to ensure the correctness of data operations and present a unified transaction processing capability to the outside world. Summary of the invention
[0005] The present application proposes a transaction processing method, which uses a separate metadata cluster to manage metadata, realizes the decoupling of metadata and computing cluster, makes it simpler and more efficient to scale nodes in the computing layer, and ensures that the database system presents a unified transaction processing capability to the outside world. The present application also provides a corresponding system, computing device cluster, computer-readable storage medium, and computer program product.
[0006] In a first aspect, the present application provides a transaction processing method, which is applied to a database system, wherein the database system includes a coordination node, a computing cluster, a metadata cluster and a storage system, and the method includes: the coordination node receives a request to process a transaction; the coordination node responds to a write data operation in the transaction, and distributes first data corresponding to the write data operation to at least one first computing node in the computing cluster; the at least one first computing node writes the first data to the storage system; the at least one first computing node stores metadata of the first data to at least one first metadata node in the metadata cluster; after responding to all operations in the transaction, the database system commits the transaction.
[0007] In one possible implementation, the transaction processing method also includes: the coordination node obtains the metadata of the old data corresponding to the update data operation from the metadata cluster in response to the update data operation in the transaction; the coordination node distributes the metadata of the old data to at least one second computing node of the computing cluster; the at least one second computing node reads the old data from the at least one second computing node or the storage system based on the metadata of the old data; the at least one second computing node updates the old data to the new data corresponding to the update data operation, and writes the new data to the storage system; the at least one second computing node stores the metadata of the new data to at least one second metadata node of the metadata cluster.
[0008] In one possible implementation, the transaction processing method also includes: the coordination node obtains metadata of second data corresponding to the query data operation from the metadata cluster in response to the query data operation in the transaction; the coordination node distributes the metadata of the second data to at least one third computing node of the computing cluster; and the at least one third computing node reads the second data from the at least one third computing node or the storage system based on the metadata of the second data.
[0009] In one possible implementation, the transaction processing method also includes: the coordination node obtains metadata of third data corresponding to the deletion data operation from the metadata cluster in response to the deletion data operation in the transaction; the coordination node distributes the metadata of the third data to at least one fourth computing node of the computing cluster; the at least one fourth computing node deletes the third data from the storage system based on the metadata of the third data; and the at least one fourth computing node notifies the metadata cluster to delete the metadata of the third data.
[0010] In the transaction processing method provided in the present application, metadata operations and data operations are unified in one transaction. The transaction is committed after the computing cluster writes the data into the storage system and stores the generated metadata into the metadata cluster, thereby ensuring the freshness and consistency of the data.
[0011] In a possible implementation, the database system also includes a global transaction manager, and the transaction processing method also includes: the coordinating node obtains a timestamp from the global transaction manager; when responding to each target operation, the coordinating node obtains metadata corresponding to the target operation from the metadata cluster according to the timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction.
[0012] In a possible implementation, the database system also includes a global transaction manager, and the transaction processing method also includes: when the coordinating node responds to each target operation, respectively obtains a timestamp for responding to the target operation from the global transaction manager, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; and the coordinating node obtains metadata corresponding to the target operation from the metadata cluster according to the timestamp.
[0013] The transaction processing method provided in this application can support both RC and RR transaction isolation levels, and can perform operations such as query optimization and pruning by obtaining metadata from the metadata cluster through the coordination node and distributing it to the computing nodes, thereby reducing data reading and sending.
[0014] In one possible implementation, the database system commits the transaction, including: the coordinating node notifies the computing nodes participating in the transaction to commit the transaction; after receiving the notification from the coordinating node, the computing nodes participating in the transaction notify the metadata nodes participating in the transaction to commit the transaction; after receiving a message returned by the metadata nodes participating in the transaction indicating that the transaction was successfully submitted, and the computing nodes participating in the transaction successfully submitted the transaction, the computing nodes participating in the transaction return a message to the coordinating node indicating that the transaction was successfully submitted; and the coordinating node feeds back to the user that the transaction is successfully submitted.
[0015] In one possible implementation, the database system commits the transaction, including: the coordination node notifies the computing nodes and metadata nodes participating in the transaction to commit the transaction; after receiving a message returned by the computing nodes participating in the transaction indicating that the transaction was successfully submitted, and receiving a message returned by the metadata nodes participating in the transaction indicating that the transaction was successfully submitted, the coordination node feeds back to the user that the transaction was successfully submitted.
[0016] In a second aspect, the present application provides a transaction processing system for implementing the transaction processing method provided by the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0017] The transaction processing system includes a coordination node, a computing cluster, a metadata cluster and a storage system, wherein the computing cluster includes at least one first computing node; the metadata cluster includes at least one first metadata node; the coordination node is used to receive a request for processing a transaction; the coordination node is also used to respond to a write data operation in the transaction and distribute the first data corresponding to the write data operation to the at least one first computing node; the at least one first computing node is used to write the first data to the storage system; the at least one first computing node is also used to store the metadata of the first data to the at least one first metadata node; the transaction processing system is used to commit the transaction after responding to all operations in the transaction.
[0018] In one possible implementation, the computing cluster also includes at least one second computing node; the metadata cluster also includes at least one second metadata node; the coordination node is also used to: in response to an update data operation in the transaction, obtain metadata of old data corresponding to the update data operation from the metadata cluster; and distribute the metadata of the old data to at least one second computing node of the computing cluster; the at least one second computing node is used to: read the old data from the at least one second computing node or the storage system according to the metadata of the old data; update the old data to new data corresponding to the update data operation, and write the new data to the storage system; and store the metadata of the new data to the at least one second metadata node.
[0019] In one possible implementation, the computing cluster also includes at least one third computing node; the coordination node is also used to: in response to a query data operation in the transaction, obtain metadata of second data corresponding to the query data operation from the metadata cluster; and distribute the metadata of the second data to the at least one third computing node; the at least one third computing node is used to: read the second data from the at least one third computing node or the storage system according to the metadata of the second data.
[0020] In one possible implementation, the computing cluster also includes at least one fourth computing node; the coordination node is also used to: in response to a delete data operation in the transaction, obtain metadata of third data corresponding to the delete data operation from the metadata cluster; and distribute the metadata of the third data to the at least one fourth computing node; the at least one fourth computing node is used to: delete the third data from the storage system according to the metadata of the third data; and notify the metadata cluster to delete the metadata of the third data.
[0021] In one possible implementation, the transaction processing system 700 also includes a global transaction manager, and the coordination node is further used to: obtain a timestamp from the global transaction manager; and when responding to each target operation, obtain metadata corresponding to the target operation from the metadata cluster according to the timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction.
[0022] In one possible implementation, the transaction processing system 700 also includes a global transaction manager, and the coordination node is further used to: when responding to each target operation, obtain a timestamp for responding to the target operation from the global transaction manager, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; and according to the timestamp, obtain metadata corresponding to the target operation from the metadata cluster.
[0023] In one possible implementation, the transaction processing system is used to commit the transaction after responding to all operations in the transaction, specifically including: the coordination node is used to notify the computing nodes participating in the transaction in the computing cluster to commit the transaction; the computing nodes participating in the transaction are used to: after receiving the notification from the coordination node, notify the metadata nodes participating in the transaction to commit the transaction; and after receiving the message returned by the metadata nodes participating in the transaction that the transaction was successfully submitted, and the computing nodes participating in the transaction successfully submitted the transaction, return a message that the transaction was successfully submitted to the coordination node; the coordination node is also used to feedback the successful submission of the transaction to the user.
[0024] In one possible implementation, the transaction processing system is used to commit the transaction after responding to all operations in the transaction, specifically including: the coordination node is used to: notify the computing nodes participating in the transaction and the metadata nodes participating in the transaction to commit the transaction; and after receiving a message returned by the computing nodes participating in the transaction indicating that the transaction was successfully submitted, and receiving a message returned by the metadata nodes participating in the transaction indicating that the transaction was successfully submitted, feedback to the user that the transaction was successfully submitted.
[0025] In a third aspect, the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs a transaction processing method corresponding to the above-mentioned first aspect or any possible implementation of the first aspect.
[0026] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device cluster, enables the computing device cluster to execute a transaction processing method corresponding to the above-mentioned first aspect or any possible implementation of the first aspect.
[0027] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes a transaction processing method corresponding to the above-mentioned first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the architecture of a database system provided in an embodiment of the present application.
[0029] Figure 2 It is a schematic diagram of two transaction management methods provided in the embodiments of the present application.
[0030] Figure 3 It is a flowchart of the transaction processing method provided in an embodiment of the present application.
[0031] Figure 4 This is a transaction processing scenario provided by an embodiment of the present application.
[0032] Figure 5 It is a flowchart of processing transaction T1 provided in an embodiment of the present application.
[0033] Figure 6 This is another flowchart diagram of processing transaction T1 provided in an embodiment of the present application.
[0034] Figure 7 It is a schematic diagram of a transaction processing system provided in an embodiment of the present application.
[0035] Figure 8 It is a schematic diagram of a computing device provided in an embodiment of the present application.
[0036] Fig. 9 It is a schematic diagram of a computing device cluster provided in an embodiment of the present application.
[0037] Fig.10 It is a schematic diagram of an implementation method of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solution provided by the present application will be described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0039] In the description of the embodiments of the present application, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0040] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0041] Big data is increasingly being used in enterprises, and databases, as a carrier for big data storage and analysis, have a huge market. Among them, cloud-native databases provide data storage services based on cloud infrastructure, and have higher cost-effectiveness and performance advantages than local databases, and are gradually becoming the first choice for major enterprises.
[0042] At present, cloud-native database systems mostly adopt a storage-computing separation architecture, storing metadata information of data on computing nodes. This makes the metadata information bound to the computing nodes, making the expansion and reduction of the computing layer complex and time-consuming. In order to improve the elastic expansion capability of the computing layer, separating the metadata information of the data from the computing nodes has become a research hotspot for cloud vendors. However, after separating the metadata information, how the database system can ensure the correctness of data operations and present a unified transaction processing capability to the outside world has become a difficult point.
[0043] To this end, the present application provides a transaction processing method, which uses a separate metadata cluster to manage metadata, realizes the decoupling of metadata and computing cluster, makes it simpler and more efficient to scale nodes at the computing layer, and at the same time ensures that the database system presents a unified transaction processing capability to the outside world.
[0044] Figure 1 A schematic diagram of the architecture of a database system provided by the present application is provided, which is used to implement the transaction processing method provided by the present application. Figure 1 Introduce the application scenarios of the above transaction processing method.
[0045] Figure 1 The database system shown includes the following modules: a global transaction manager (GTM), a coordination node (CN), a computing cluster, a metadata cluster, and a storage system.
[0046] The global transaction manager GTM is used to ensure the order of global transactions. During the transaction processing, it is responsible for issuing transaction information, which includes timestamps and transaction sequence numbers. GTM can be used as a separate module or as a submodule in a computing cluster or metadata cluster.
[0047] The coordination node CN is used to receive transaction processing requests from users and send them to the computing cluster, and is responsible for coordinating the start and submission of transactions.
[0048] The computing cluster includes multiple data nodes (Data Node, DN), and a database instance is deployed on each data node. In the embodiment of the present application, the data nodes in the computing cluster are also referred to as computing nodes. The computing cluster is used to process user access, including writing data to the storage system and reading data from the storage system, as well as storing metadata on the metadata cluster and reading metadata from the metadata cluster.
[0049] The metadata cluster includes multiple data nodes, and a database instance is deployed on each data node. In the embodiment of the present application, the data nodes in the metadata cluster are also referred to as metadata nodes. The metadata cluster is used to store metadata information, wherein the metadata information includes schema information of the table, the status of the transaction, logs, and description information of the data. The description information of the data includes information such as the size of the database, the maximum value of the data, the minimum value of the data, the number of data, etc. As an independent system, the metadata cluster can be a cluster mode or a stand-alone mode, an OLTP system, or a KV storage system with transaction capabilities. In addition, the metadata can be stored in the local disk of the metadata cluster, or it can be stored in the storage system together with the data.
[0050] The storage system is used to store data in the database, and can be a storage system such as the Object Storage Service (OBS). The storage system can also be used to store metadata written by the metadata cluster.
[0051] exist Figure 1 In the database system shown, when data access occurs, the computing cluster first obtains metadata information from the metadata cluster, and then reads the required data from the storage system based on the metadata information; when data modification occurs, the computing cluster writes the newly generated data into the storage system and stores the metadata corresponding to the data in the metadata cluster.
[0052] When data modification occurs, in order to ensure the freshness of the data, that is, to enable the data modification to be immediately read by other transactions, the coordination node, computing cluster and metadata cluster need to coordinate with each other to manage the transaction. Figure 1 The database system shown provides Figure 2 Two possible transaction management methods are shown: (a) cascade management method and (b) unified management method. In the cascade management method, when data modification occurs in a transaction, the coordinating node is responsible for recording which computing nodes participated in the data modification so as to notify the corresponding computing nodes to commit the transaction smoothly; the computing nodes are responsible for recording which metadata nodes participated in the data modification so as to notify the corresponding metadata nodes to commit the transaction smoothly. In the unified management method, when data modification occurs in a transaction, the coordinating node is responsible for uniformly recording which computing nodes and metadata nodes participated in the data modification so as to notify the corresponding computing nodes and metadata nodes to commit the transaction smoothly.
[0053] Figure 3 A flow chart of the transaction processing method provided by the present application is given. The transaction processing method is applied to Figure 1 The database system shown includes the following steps 201 to 205:
[0054] Step 201: The coordinating node receives a request to process a transaction.
[0055] Specifically, the user can issue a "begin" command to the coordinating node to request the processing of a transaction. The coordinating node starts the transaction after receiving the "begin" command.
[0056] Step 202: In response to the write data operation in the transaction, the coordinating node distributes first data corresponding to the write data operation to at least one first computing node in the computing cluster.
[0057] After a transaction is started, the user sends a data operation instruction to the coordinating node to request the execution of a specific data operation. For example, the user sends an "insert" statement to the coordinating node to request the execution of a write data operation.
[0058] Specifically, after receiving an "insert" statement for writing the first data into the database, the coordination node distributes the first data to at least one first computing node in the computing cluster.
[0059] In a possible embodiment, since in a distributed system, data is managed in shards, and multiple computing nodes in a computing cluster are responsible for data of different shards, the coordination node distributes the first data to the computing nodes corresponding to the data shard to which the first data belongs; when the first data contains data of multiple shards, the coordination node distributes the first data to multiple computing nodes corresponding to the above-mentioned multiple shards.
[0060] In a possible embodiment, the coordination node may distribute the first data to one or more computing nodes with less load pressure in the computing cluster according to the load conditions of each computing node.
[0061] Step 203: The at least one first computing node writes the first data into the storage system.
[0062] Step 204: The at least one first computing node stores the metadata of the first data to at least one first metadata node of the metadata cluster.
[0063] Specifically, the at least one first computing node sends metadata generated when writing the first data to at least one first metadata node of the metadata cluster for storage. The first metadata node may store the received metadata of the first data in the first metadata node or the storage system.
[0064] In a possible embodiment, metadata is managed by partitions, and multiple metadata nodes in the metadata cluster are responsible for metadata of different partitions, so the at least one first computing node sends the metadata of the first data to the metadata node corresponding to the partition to which the metadata of the first data belongs; when the metadata of the first data contains metadata of multiple partitions, the at least one first computing node sends the metadata of the first data to multiple metadata nodes corresponding to the above-mentioned multiple partitions.
[0065] In a possible embodiment, the computing node may distribute the metadata of the first data to metadata nodes with less load pressure in the metadata cluster according to the load conditions of each metadata node.
[0066] Step 205: After responding to all operations in the transaction, the database system commits the transaction.
[0067] After all operations in the transaction have been responded to, the user can send a "commit" command to the coordinating node to request the database system to commit the transaction.
[0068] In the embodiment of the present application, corresponding to the two transaction management methods described above, there are also two processes for the database system to submit transactions.
[0069] When the database system adopts Figure 2 In the cascade management mode shown in (a), the process of transaction submission by the database system includes the following steps 301 to 305:
[0070] Step 301: The coordinating node notifies the global transaction manager to commit the transaction.
[0071] In a possible embodiment, the database system performs two-phase commit on transactions.
[0072] After receiving the "commit" command issued by the user, the coordinating node will first send a "prepare" command to the computing nodes participating in the transaction to notify the computing nodes to prepare for transaction submission; at the same time, after receiving the "prepare" command from the coordinating node, the computing node will notify the metadata nodes participating in the transaction to prepare for transaction submission; after the computing node receives the successful preparation message returned by the metadata node and the computing node itself is also successfully prepared, the computing node returns a successful preparation message to the coordinating node.
[0073] After receiving the successful preparation message from the computing node, the coordinating node notifies the global transaction manager to commit the transaction. Specifically, after the transaction is started, the coordinating node will go to the global transaction manager to apply for the transaction sequence number. When the transaction needs to be committed, the coordinating node notifies the global transaction manager to mark the transaction corresponding to the sequence number as successfully committed.
[0074] Step 302: The coordinating node notifies the computing nodes participating in the transaction to commit the transaction.
[0075] Step 303: After receiving the notification from the coordination node, the computing node participating in the transaction notifies the metadata nodes participating in the transaction to commit the transaction.
[0076] Step 304: After receiving the message of successful transaction submission returned by the metadata node participating in the transaction and the computing node participating in the transaction successfully submits the transaction, the computing node participating in the transaction returns a message of successful transaction submission to the coordination node.
[0077] Step 305: The coordination node feeds back to the user that the transaction was successfully submitted.
[0078] When the database system adopts cascading management, during the transaction commit phase, the transaction logic of the coordination node does not need to be aware of the metadata node.
[0079] When the database system adopts Figure 2 In the unified management mode shown in (b), the process of transaction submission by the database system includes the following steps 311 to 313:
[0080] Step 311: The coordinating node notifies the global transaction manager to commit the transaction.
[0081] In a possible embodiment, the database system performs two-phase commit on transactions.
[0082] After receiving the "commit" command issued by the user, the coordinating node will send a "prepare" command to the computing nodes and metadata nodes participating in the transaction; after receiving the "prepare" command from the coordinating node, the computing nodes and metadata nodes will prepare for transaction submission; after receiving the successful preparation message returned by the computing nodes and metadata nodes, the coordinating node will notify the global transaction manager to commit the transaction.
[0083] Specifically, after the transaction is started, the coordinating node will apply for the transaction sequence number from the global transaction manager. When the transaction needs to be committed, the coordinating node notifies the global transaction manager to mark the transaction corresponding to the sequence number as successfully committed.
[0084] Step 312: The coordinating node notifies the computing nodes and metadata nodes participating in the transaction to commit the transaction.
[0085] Step 313: After receiving a message indicating that the transaction has been successfully submitted from a computing node participating in the transaction and receiving a message indicating that the transaction has been successfully submitted from a metadata node participating in the transaction, the coordinator node feeds back to the user that the transaction has been successfully submitted.
[0086] In the transaction processing method provided in the present application, metadata operations and data operations are unified in one transaction. The transaction is committed after the computing cluster writes the data into the storage system and stores the generated metadata into the metadata cluster, thereby ensuring the freshness and consistency of the data.
[0087] In actual applications, in addition to writing data, there are also updating data, querying data, and deleting data. Figure 2 The response process to several other data operations in the transaction processing method provided by this application is introduced.
[0088] In a possible embodiment, the transaction processing method further includes the following steps 212 to 216:
[0089] Step 212: In response to the data update operation in the transaction, the coordinating node obtains metadata of old data corresponding to the data update operation from the metadata cluster.
[0090] For example, a user sends an "update" statement to the coordinating node to request to execute an update data operation, wherein the update data operation is used to update old data to new data.
[0091] Step 213: The coordination node distributes the metadata of the old data to at least one second computing node in the computing cluster.
[0092] Step 214: The at least one second computing node reads the old data from the at least one second computing node or the storage system according to the metadata of the old data.
[0093] Step 215: The at least one second computing node updates the old data to new data corresponding to the data update operation, and writes the new data into the storage system.
[0094] Step 216: The at least one second computing node stores the metadata of the new data to at least one second metadata node of the metadata cluster.
[0095] In a possible embodiment, the transaction processing method further includes the following steps 222 to 224:
[0096] Step 222: In response to the query data operation in the transaction, the coordinating node obtains metadata of the second data corresponding to the query data operation from the metadata cluster.
[0097] For example, the user sends a "select" statement to the coordination node to request to execute a data query operation. Specifically, after receiving the "select" statement for querying the second data, the coordination node obtains metadata of the second data from the metadata cluster.
[0098] Step 223: The coordination node distributes the metadata of the second data to at least one third computing node in the computing cluster.
[0099] Step 224: The at least one third computing node reads the second data from the at least one third computing node or the storage system according to the metadata of the second data.
[0100] In a possible embodiment, the transaction processing method further includes the following steps 232 to 235:
[0101] Step 232: In response to the delete data operation in the transaction, the coordinating node obtains metadata of the third data corresponding to the delete data operation from the metadata cluster.
[0102] For example, the user sends a "delete" statement to the coordination node to request to execute a data deletion operation. Specifically, after receiving the "delete" statement for deleting the third data, the coordination node obtains metadata of the third data from the metadata cluster.
[0103] Step 233: The coordination node distributes the metadata of the third data to at least one fourth computing node of the computing cluster.
[0104] Step 234: The at least one fourth computing node deletes the third data from the storage system according to the metadata of the third data.
[0105] Step 235: The at least one fourth computing node notifies the metadata cluster to delete the metadata of the third data.
[0106] In one possible embodiment, after receiving a notification to delete the metadata of the third data, the metadata cluster physically deletes the metadata of the third data from the storage location; in another possible embodiment, after receiving a notification to delete the metadata of the third data, the metadata cluster marks the metadata of the third data as deleted.
[0107] At present, there are two important transaction isolation levels in database systems: Read Committed (RC) level and Repeatable Read (RR) level. Under the RC transaction isolation level, a transaction must wait for another transaction to commit before reading data; while under the RR isolation level, the data read during a transaction is expected to remain unchanged, that is, after the transaction is started, it is no longer allowed to read data modified by other transactions. The transaction processing method provided in this application can support both RC and RR isolation levels.
[0108] When the RC isolation level needs to be implemented, the coordinating node can obtain the timestamp used to respond to the target operation from the global transaction manager when responding to each target operation, where the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; thereafter, the coordinating node obtains the metadata corresponding to the target operation from the metadata cluster according to the timestamp used to respond to the target operation.
[0109] When the RR isolation level needs to be implemented, the coordinating node only needs to obtain a unified timestamp from the global transaction manager in the transaction. After that, when responding to each target operation, the coordinating node obtains the metadata of the data corresponding to the target operation from the metadata cluster according to the unified timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction. Specifically, the coordinating node can obtain the unified timestamp from the global transaction manager after receiving the first instruction for requesting to execute the target operation, or it can obtain the unified timestamp from the global transaction manager after receiving the transaction processing request.
[0110] In a possible embodiment, the timestamp is a read timestamp of a snapshot of a transaction obtained by the coordinating node from the global transaction manager.
[0111] The transaction processing method provided in the present application can perform operations such as query optimization and pruning by obtaining metadata from a metadata cluster through a coordinating node and distributing the metadata to computing nodes, thereby reducing data reading and sending.
[0112] Figure 4 A specific application scenario is given, in which the transaction T1 opened by the user contains two statements, "select" and "update", wherein the "select" statement needs to query data A when executed, the "update" statement is used to update data B to data C, the "begin" command is used to open the transaction, and the "commit" command is used to request to commit the transaction. The following describes the process of processing transaction T1 using the transaction processing method of the present application.
[0113] Figure 5 A schematic diagram of a process of processing transaction T1 in a database system using the RR isolation level and the cascade management mode is given. The process includes the following steps 501 to 526:
[0114] Step 501: The coordination node receives a “begin” command issued by a user.
[0115] After receiving the "begin" command sent by the user, the coordinating node starts transaction T1.
[0116] Step 502: The coordination node receives a “select” command sent by the user.
[0117] After the coordinating node starts transaction T1, it first receives the "select" command in transaction T1.
[0118] Step 503: After receiving the "select" command, the coordinating node obtains the timestamp TS1 from the global transaction manager.
[0119] Since the execution of the "select" command involves reading data, the coordinating node obtains the timestamp after receiving the "select" command. Specifically, the coordinating node obtains the timestamp TS1 by obtaining the snapshot of the transaction from the global transaction manager. The timestamp TS1 is the read timestamp of the snapshot of the transaction.
[0120] Step 504: The coordinating node obtains metadata A0 of data A from the metadata cluster according to timestamp TS1.
[0121] exist Figure 5 In the example, the coordinating node specifically obtains metadata A0 from metadata node DN4.
[0122] Step 505: The coordination node distributes metadata A0 to computing node DN1.
[0123] exist Figure 5 In the example, the data that the "select" command wants to query only involves computing node DN1, so the coordination node distributes metadata A0 to computing node DN1. In another possible scenario, multiple computing nodes in the computing cluster are responsible for data of different shards, and the data that the "select" command wants to query involves computing nodes DN1 and DN2 at the same time, so the coordination node needs to distribute metadata A0 to computing nodes DN1 and DN2.
[0124] Step 506: The computing node DN1 reads the data A according to the metadata A0.
[0125] exist Figure 5 In the example, computing node DN1 reads data A from the storage system; in another case, the computing node may read data A from the memory of computing node DN1.
[0126] Step 507: The computing node DN1 returns the execution result of the “select” command to the coordination node.
[0127] Step 508: The coordination node returns the execution result of the "select" command to the user.
[0128] Step 509: The coordination node receives the “update” command sent by the user.
[0129] In a possible embodiment, after the computing node DN1 finds the data A corresponding to the "select" command, it directly returns the data A as the execution result of the "select" command to the coordination node, and then the coordination node returns the data A to the user.
[0130] In another possible embodiment, after the computing node DN1 finds the data A corresponding to the "select" command, it will further process the data A to obtain the final execution result, and then return the execution result to the coordination node. The further processing of the data A by DN1 and DN2 includes but is not limited to operations such as visualizing the data into charts, classifying and arranging the data, forming text answers based on the data statistics, and generating new results based on the data calculations.
[0131] Step 510: The coordinating node obtains metadata B0 of data B from the metadata cluster according to timestamp TS1.
[0132] because Figure 5 In the example, the database system uses the RR isolation level. Therefore, after transaction T1 is started, the coordinating node only needs to obtain a timestamp from the global transaction manager when it receives the first command involving reading data in transaction T1, namely the "select" command.
[0133] exist Figure 5 In the example, the coordinating node specifically obtains metadata B0 from metadata nodes DN3 and DN4.
[0134] Step 511: The coordinating node distributes the metadata B0 to the computing node DN2.
[0135] exist Figure 5 In the example, the data B corresponding to the "update" command only involves the computing node DN2, so the coordination node distributes the metadata B0 to the computing node DN2.
[0136] Step 512: Computing node DN2 reads data B according to metadata B0.
[0137] Step 513: Computing node DN2 updates data B to data C.
[0138] Step 514: Computing node DN2 writes data C into the storage system.
[0139] Step 515: Computing node DN2 stores the metadata of data C to metadata nodes DN3 and DN4.
[0140] Step 516: The computing node DN2 returns the execution result of the "update" command to the coordination node.
[0141] Step 517: The coordination node returns the execution result of the "update" command to the user.
[0142] In a possible embodiment, the execution result of the "update" command may include one or more of the following information: data update success, the number of rows written by the updated data, the storage location of the updated data, and the like.
[0143] Step 518: The coordinating node receives the "commit" command sent by the user.
[0144] Step 519: The coordination node sends a "prepare" command to the computing node DN2.
[0145] Since the transaction adopts a two-phase commit method, after receiving the "commit" command, the coordinating node will first send a "prepare" command to the computing node DN2 to notify the computing node DN2 to prepare before the transaction is committed.
[0146] Step 520: Computing node DN2 sends a “prepare” command to metadata nodes DN3 and DN4.
[0147] Step 521: After receiving the message indicating that the "prepare" command has been successfully executed from metadata nodes DN3 and DN4, and computing node DN2 itself has been successfully prepared, computing node DN2 returns a message indicating that the "prepare" command has been successfully executed to the coordination node.
[0148] Step 522: The coordinating node notifies the global transaction manager to commit transaction T1.
[0149] Step 523: The coordinating node sends a "commit" command to the computing node DN2.
[0150] Specifically, the coordinating node notifies computing node DN2 to commit transaction T1 by sending a "commit" command to computing node DN2.
[0151] Step 524: Compute node DN2 sends a “commit” command to metadata nodes DN3 and DN4.
[0152] Under the cascading management mode, the coordinating node is responsible for recording the computing nodes that participate in modifying data in the transaction, so that during the transaction submission phase, the coordinating node notifies the corresponding computing node to submit the transaction; and the computing node is responsible for recording the metadata nodes that it manages in the transaction, so that during the transaction submission phase, the computing node notifies the corresponding metadata node to submit the transaction.
[0153] exist Figure 5 In the example, when processing transaction T1, compute node DN2 participated in writing data C and stored the metadata of data C in metadata nodes DN3 and DN4. Therefore, in the transaction commit phase, the coordinating node is responsible for notifying compute node DN2 to commit transaction T1, and compute node DN2 is responsible for notifying metadata nodes DN3 and DN4 to commit transaction T1.
[0154] Step 525: After receiving the message indicating that the “commit” command has been successfully executed from metadata nodes DN3 and DN4, and computing node DN2 itself has successfully committed transaction T1, computing node DN2 returns a message indicating that the “commit” command has been successfully executed to the coordination node.
[0155] Step 526: The coordinating node feeds back to the user that transaction T1 was submitted successfully.
[0156] Figure 6 A schematic diagram of a process of processing transaction T1 by a database system using the RC isolation level and the unified management method is given. The process includes the following steps 601 to 623:
[0157] Step 601: The coordination node receives a “begin” command sent by a user.
[0158] Step 602: The coordinating node receives a “select” command sent by the user.
[0159] Step 603: After receiving the "select" command, the coordinating node obtains the timestamp TS1 from the global transaction manager.
[0160] Step 604: The coordinating node obtains metadata A0 of data A from the metadata cluster according to timestamp TS1.
[0161] Step 605: The coordination node distributes metadata A0 to computing node DN1.
[0162] Step 606: Computing node DN1 reads data A according to metadata A0.
[0163] Step 607: The computing node DN1 returns the execution result of the “select” command to the coordination node.
[0164] Step 608: The coordination node returns the execution result of the "select" command to the user.
[0165] Step 609: The coordination node receives the “update” command sent by the user.
[0166] Step 610: After receiving the "update" command, the coordinating node obtains the timestamp TS2 from the global transaction manager.
[0167] because Figure 6 In the example, the database system uses the RC isolation level. Therefore, after transaction T1 is started, the coordinating node needs to obtain the timestamp from the global transaction manager every time it receives a command involving reading data in transaction T1.
[0168] Step 611: The coordinating node obtains metadata B0 of data B from the metadata cluster according to timestamp TS2.
[0169] Step 612: The coordination node distributes the metadata B0 to the computing node DN2.
[0170] Step 613: Computing node DN2 reads data B according to metadata B0.
[0171] Step 614: Computing node DN2 updates data B to data C.
[0172] Step 615: Computing node DN2 writes data C into the storage system.
[0173] Step 616: Computing node DN2 stores the metadata of data C to metadata nodes DN3 and DN4.
[0174] Step 617: The computing node DN2 returns the execution result of the "update" command to the coordination node.
[0175] Step 618: The coordination node returns the execution result of the "update" command to the user.
[0176] Step 619: The coordinating node receives the “commit” command sent by the user.
[0177] Step 620: The coordination node sends a "prepare" command to the computing node DN2 and the metadata nodes DN3 and DN4.
[0178] Step 621: After receiving the message indicating that the "prepare" command is successfully executed from the computing node DN2 and the metadata nodes DN3 and DN4, the computing node DN2 returns the message indicating that the "prepare" command is successfully executed to the coordination node.
[0179] Step 622: The coordinating node notifies the global transaction manager to commit transaction T1.
[0180] Step 623: The coordination node sends a "commit" command to the computing node DN2 and the metadata nodes DN3 and DN4.
[0181] Step 624: After receiving the message that the "commit" command is successfully executed from all the computing node DN2 and metadata nodes DN3 and DN4, the coordination node feeds back to the user that the transaction T1 is successfully submitted.
[0182] This application also provides a Figure 7 The transaction processing system 700 shown is used to implement the transaction processing method described above. The transaction processing system 700 may be Figure 1 The database system shown.
[0183] The transaction processing system 700 includes a coordination node, a computing cluster, a metadata cluster and a storage system, wherein the computing cluster includes at least one first computing node; the metadata cluster includes at least one first metadata node; the coordination node is used to receive a request for processing a transaction; the coordination node is also used to respond to a write data operation in the transaction and distribute the first data corresponding to the write data operation to the at least one first computing node; the at least one first computing node is used to write the first data to the storage system; the at least one first computing node is also used to store the metadata of the first data to the at least one first metadata node; the transaction processing system is used to commit the transaction after responding to all operations in the transaction.
[0184] In a possible embodiment, the computing cluster also includes at least one second computing node; the metadata cluster also includes at least one second metadata node; the coordination node is also used to: in response to an update data operation in the transaction, obtain metadata of old data corresponding to the update data operation from the metadata cluster; and distribute the metadata of the old data to at least one second computing node of the computing cluster; the at least one second computing node is used to: read the old data from the at least one second computing node or the storage system according to the metadata of the old data; update the old data to new data corresponding to the update data operation, and write the new data to the storage system; and store the metadata of the new data to the at least one second metadata node.
[0185] In a possible embodiment, the computing cluster also includes at least one third computing node; the coordination node is also used to: in response to a query data operation in the transaction, obtain metadata of second data corresponding to the query data operation from the metadata cluster; and distribute the metadata of the second data to the at least one third computing node; the at least one third computing node is used to: read the second data from the at least one third computing node or the storage system according to the metadata of the second data.
[0186] In a possible embodiment, the computing cluster also includes at least one fourth computing node; the coordination node is also used to: in response to a delete data operation in the transaction, obtain metadata of third data corresponding to the delete data operation from the metadata cluster; and distribute the metadata of the third data to the at least one fourth computing node; the at least one fourth computing node is used to: delete the third data from the storage system according to the metadata of the third data; and notify the metadata cluster to delete the metadata of the third data.
[0187] In a possible embodiment, the transaction processing system 700 also includes a global transaction manager, and the coordination node is further used to: obtain a timestamp from the global transaction manager; and when responding to each target operation, obtain metadata corresponding to the target operation from the metadata cluster according to the timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction.
[0188] In a possible embodiment, the transaction processing system 700 also includes a global transaction manager, and the coordination node is further used to: when responding to each target operation, obtain a timestamp used to respond to the target operation from the global transaction manager, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; and according to the timestamp, obtain metadata corresponding to the target operation from the metadata cluster.
[0189] In a possible embodiment, the transaction processing system is used to commit the transaction after responding to all operations in the transaction, specifically including:
[0190] The coordination node is used to notify the computing nodes participating in the transaction in the computing cluster to submit the transaction;
[0191] The computing node participating in the transaction is used to: after receiving the notification from the coordination node, notify the metadata node participating in the transaction to submit the transaction; and after receiving the message returned by the metadata node participating in the transaction that the transaction was successfully submitted and the computing node participating in the transaction successfully submitted the transaction, return a message to the coordination node that the transaction was successfully submitted;
[0192] The coordination node is also used to feedback to the user that the transaction submission is successful.
[0193] In a possible embodiment, the transaction processing system is used to commit the transaction after responding to all operations in the transaction, specifically including:
[0194] The coordination node is used to: notify the computing nodes and metadata nodes participating in the transaction to submit the transaction; and, after receiving a message from the computing nodes participating in the transaction indicating that the transaction was successfully submitted and receiving a message from the metadata nodes participating in the transaction indicating that the transaction was successfully submitted, provide feedback to the user on the successful submission of the transaction.
[0195] Specifically, the specific implementation of various operations of the transaction processing method executed by the transaction processing system can refer to the description of the relevant content in the above method embodiment, which will not be repeated here.
[0196] In the embodiment of the present application, the coordination node, computing cluster, metadata cluster, and global transaction manager in the transaction processing system 700 can be implemented by software or by hardware. The following is an exemplary introduction to the implementation of the computing cluster, and the implementation of the coordination node, metadata cluster, and global transaction manager can be used as a reference.
[0197] As an example of a software functional unit, a computing cluster may include code running on a computing instance. The computing instance may be at least one of a physical host (computing device), a virtual machine, a container, and other computing devices. Furthermore, the computing device may be one or more. For example, a computing cluster may include code running on multiple hosts, or virtual machines, or containers. It should be noted that multiple hosts, or virtual machines, or containers for running the code may be distributed in the same AZ or in different AZs, and each AZ includes a data center or multiple data centers with similar geographical locations. Multiple hosts, or virtual machines, or containers for running the code may be distributed in the same region or in different regions. Generally, a region may include multiple AZs, and VPCs are set in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.
[0198] Similarly, multiple hosts or virtual machines or containers for running the code may be distributed in the same VPC or in multiple VPCs, wherein usually a region may include multiple AZs.
[0199] As an example of a hardware functional unit, a computing cluster may include at least one computing device, such as a server, etc. Alternatively, the computing cluster may also be a device implemented using ASIC or PLD, etc. The PLD may be implemented using CPLD, FPGA, GAL or any combination thereof.
[0200] The multiple computing devices included in the computing cluster can be distributed in the same AZ or in different AZs. The multiple computing devices included in the module can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0201] The present application also provides a computing device 800, Figure 8800 is a schematic diagram of the structure of a computing device 800. The computing device 800 includes: a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate with each other through the bus 802. The computing device 800 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 800.
[0202] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus 802 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 802 may include a path for transmitting information between various components of the computing device 800 (eg, the memory 806, the processor 804, and the communication interface 808).
[0203] The processor 804 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0204] The memory 806 may include a volatile memory, such as a random access memory (RAM). The memory 806 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0205] The memory 806 stores executable program codes, and the processor 804 executes the executable program codes to respectively implement the functions of the aforementioned coordination node, computing cluster, metadata cluster, and global transaction manager, thereby implementing the transaction processing method. That is, the memory 806 stores instructions for executing the transaction processing method.
[0206] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or communication networks.
[0207] The present application also provides a computing device cluster, Fig. 9 is a schematic diagram of the computing device cluster, which can implement the transaction processing method in the above embodiment. Fig. 9 As shown, the computing device cluster includes at least one Figure 8 The computing device 800 shown may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0208] The memory 806 in one or more computing devices 800 in the computing device cluster may store instructions for executing the transaction processing method. When at least one computing device in the computing device cluster executes the instructions, the computing device cluster may implement the transaction processing method as described in the embodiment.
[0209] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store partial instructions for executing the transaction processing method. In other words, the combination of one or more computing devices 800 may jointly execute instructions for executing the transaction processing method.
[0210] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the transaction processing system. That is, the instructions stored in the memory 506 in different computing devices 500 can realize the functions of the coordination node, computing cluster, metadata cluster, and global transaction manager.
[0211] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.10 A possible implementation is shown. Fig.10 As shown, two computing devices 800A and 800B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the coordination node and the global transaction manager in the transaction processing system; at the same time, the memory 806 in the computing device 800B stores instructions for executing the functions of the computing cluster and the metadata cluster.
[0212] It should be understood that Fig.10 The functions of the computing device 800A shown in FIG. 8 may also be completed by multiple computing devices 800. Similarly, the functions of the computing device 800B may also be completed by multiple computing devices 800.
[0213] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to perform a transaction processing method.
[0214] The present application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct a computing device to execute a transaction processing method, or instructs a computing device to execute a transaction processing method.
[0215] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A transaction processing method, characterized in that: The method is applied to a database system, the database system includes a coordination node, a computing cluster, a metadata cluster and a storage system, and the method includes: The coordinating node receives a request for processing a transaction; The coordination node distributes, in response to the write data operation in the transaction, first data corresponding to the write data operation to at least one first computing node in the computing cluster; The at least one first computing node writes the first data into the storage system; The at least one first computing node stores the metadata of the first data to at least one first metadata node of the metadata cluster; After responding to all operations in the transaction, the database system commits the transaction.
2. The method according to claim 1, characterized in that The method further comprises: The coordinating node obtains metadata of old data corresponding to the update data operation from the metadata cluster in response to the update data operation in the transaction; The coordination node distributes the metadata of the old data to at least one second computing node of the computing cluster; The at least one second computing node reads the old data from the at least one second computing node or the storage system according to the metadata of the old data; The at least one second computing node updates the old data to new data corresponding to the data update operation, and writes the new data into the storage system; The at least one second computing node stores the metadata of the new data to at least one second metadata node of the metadata cluster.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The coordination node obtains metadata of second data corresponding to the query data operation from the metadata cluster in response to the query data operation in the transaction; The coordination node distributes the metadata of the second data to at least one third computing node of the computing cluster; The at least one third computing node reads the second data from the at least one third computing node or the storage system according to the metadata of the second data.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to the data deletion operation in the transaction, the coordinating node obtains metadata of third data corresponding to the data deletion operation from the metadata cluster; The coordination node distributes the metadata of the third data to at least one fourth computing node of the computing cluster; The at least one fourth computing node deletes the third data from the storage system according to the metadata of the third data; The at least one fourth computing node notifies the metadata cluster to delete the metadata of the third data.
5. The method according to any one of claims 1 to 4, characterized in that The database system further includes a global transaction manager, and the method further includes: The coordinating node obtains a timestamp from the global transaction manager; When responding to each target operation, the coordinating node obtains metadata corresponding to the target operation from the metadata cluster according to the timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction.
6. The method according to any one of claims 1 to 4, characterized in that The database system further includes a global transaction manager, and the method further includes: When responding to each target operation, the coordinating node obtains a timestamp for responding to the target operation from the global transaction manager, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; The coordinating node obtains the metadata corresponding to the target operation from the metadata cluster according to the timestamp.
7. The method according to any one of claims 1 to 6, characterized in that The database system submits the transaction, including: The coordinating node notifies the computing nodes participating in the transaction to submit the transaction; After receiving the notification from the coordinating node, the computing node participating in the transaction notifies the metadata nodes participating in the transaction to submit the transaction; After receiving a message indicating that the transaction was successfully submitted, which is returned by the metadata node participating in the transaction, and the computing node participating in the transaction successfully submits the transaction, the computing node participating in the transaction returns a message indicating that the transaction was successfully submitted to the coordination node; The coordination node feeds back to the user that the transaction is successfully submitted.
8. The method according to any one of claims 1 to 6, characterized in that The database system submits the transaction, including: The coordination node notifies the computing nodes and metadata nodes participating in the transaction to submit the transaction; After receiving a message from the computing node participating in the transaction indicating that the transaction was successfully submitted, and after receiving a message from the metadata node participating in the transaction indicating that the transaction was successfully submitted, the coordination node feeds back to the user that the transaction was successfully submitted.
9. A transaction processing system, characterized in that: The transaction processing system includes a coordination node, a computing cluster, a metadata cluster and a storage system, wherein: The computing cluster includes at least one first computing node; The metadata cluster includes at least one first metadata node; The coordinating node is used to receive a request for processing a transaction; The coordinating node is further configured to distribute, in response to a write data operation in the transaction, first data corresponding to the write data operation to the at least one first computing node; The at least one first computing node is used to write the first data into the storage system; The at least one first computing node is further used to store metadata of the first data to the at least one first metadata node; The transaction processing system is used to commit the transaction after responding to all operations in the transaction.
10. The system according to claim 9, characterized in that The computing cluster further includes at least one second computing node; The metadata cluster also includes at least one second metadata node; The coordination node is further configured to: in response to an update data operation in the transaction, obtain metadata of old data corresponding to the update data operation from the metadata cluster; and distribute the metadata of the old data to at least one second computing node in the computing cluster; The at least one second computing node is used to: read the old data from the at least one second computing node or the storage system according to the metadata of the old data; Updating the old data to new data corresponding to the data update operation, and writing the new data into the storage system; And, storing the metadata of the new data in the at least one second metadata node.
11. The system according to claim 9 or 10, characterized in that: The computing cluster further includes at least one third computing node; The coordination node is further configured to: in response to a query data operation in the transaction, obtain metadata of second data corresponding to the query data operation from the metadata cluster; and distribute the metadata of the second data to the at least one third computing node; The at least one third computing node is used to read the second data from the at least one third computing node or the storage system according to metadata of the second data.
12. The system according to any one of claims 9 to 11, characterized in that The computing cluster further includes at least one fourth computing node; The coordination node is further configured to: in response to a delete data operation in the transaction, obtain metadata of third data corresponding to the delete data operation from the metadata cluster; and distribute the metadata of the third data to the at least one fourth computing node; The at least one fourth computing node is used to: delete the third data from the storage system according to the metadata of the third data; And, notifying the metadata cluster to delete the metadata of the third data.
13. The system according to any one of claims 9 to 12, characterized in that The transaction processing system further includes a global transaction manager, and the coordination node is further configured to: Obtaining a timestamp from the global transaction manager; In response to each target operation, metadata corresponding to the target operation is obtained from the metadata cluster according to the timestamp, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction.
14. The system according to any one of claims 9 to 12, characterized in that The transaction processing system further includes a global transaction manager, and the coordination node is further configured to: When responding to each target operation, respectively obtaining a timestamp for responding to the target operation from the global transaction manager, wherein the target operation is an update data operation, a query data operation, or a delete data operation in the transaction; According to the timestamp, metadata corresponding to the target operation is acquired from the metadata cluster.
15. The system according to any one of claims 9 to 14, characterized in that The transaction processing system is used to submit the transaction after responding to all operations in the transaction, specifically including: The coordination node is used to notify the computing nodes participating in the transaction in the computing cluster to submit the transaction; The computing node participating in the transaction is used to: after receiving the notification from the coordination node, notify the metadata node participating in the transaction to submit the transaction; and after receiving the message returned by the metadata node participating in the transaction that the transaction was successfully submitted and the computing node participating in the transaction successfully submitted the transaction, return a message to the coordination node that the transaction was successfully submitted; The coordination node is also used to feedback to the user that the transaction submission is successful.
16. The system according to any one of claims 9 to 14, characterized in that The transaction processing system is used to submit the transaction after responding to all operations in the transaction, specifically including: The coordination node is used to: notify the computing nodes and metadata nodes participating in the transaction to submit the transaction; and, after receiving a message from the computing nodes participating in the transaction indicating that the transaction was successfully submitted and receiving a message from the metadata nodes participating in the transaction indicating that the transaction was successfully submitted, provide feedback to the user on the successful submission of the transaction.
17. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the transaction processing method according to any one of claims 1 to 8.
18. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the transaction processing method according to any one of claims 1 to 8.
19. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the transaction processing method according to any one of claims 1 to 8.