CN109783578A - Method for reading data, device, electronic equipment and storage medium - Google Patents

Method for reading data, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109783578A
CN109783578A CN201910021181.9A CN201910021181A CN109783578A CN 109783578 A CN109783578 A CN 109783578A CN 201910021181 A CN201910021181 A CN 201910021181A CN 109783578 A CN109783578 A CN 109783578A
Authority
CN
China
Prior art keywords
global
transaction
affairs
global write
node device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910021181.9A
Other languages
Chinese (zh)
Other versions
CN109783578B (en
Inventor
李海翔
卢卫
杜小勇
潘安群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910021181.9A priority Critical patent/CN109783578B/en
Publication of CN109783578A publication Critical patent/CN109783578A/en
Application granted granted Critical
Publication of CN109783578B publication Critical patent/CN109783578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method for reading data, device, electronic equipment and storage mediums, belong to database technical field.Method provided in an embodiment of the present invention, global write affairs in active state when being occurred by finding current global read transaction, to determine the global write affairs that may influence transaction consistency, it that is to say and have found between multiple node devices, based on MVCC's, the common point with transaction consistency, reading based on such global write affairs, be equivalent to by the read moment put off until one more postpone relative to current time at the time of on, it can be regarded as a kind of process that delay is read, and in data read process, it may cause the inconsistent global write affairs of affairs due to eliminating, so that read data have transaction consistency, realize the external data consistency of Database Systems.

Description

Method for reading data, device, electronic equipment and storage medium
Technical field
The present invention relates to database technical field, in particular to a kind of method for reading data, device, electronic equipment and deposit Storage media.
Background technique
Current distributed data base system can much support the write operation of cross-node, that is to say, some is write For operation, the writing process to node devices multiple in distributed data base system may relate to, it is thereby possible to can generate The consistency problem of data is read, such as: when realizing the write operation of cross-node, it is assumed that there are two node devices, have been subjected to Preparing presentation stage, affairs can be submitted, and first node device, which is submitted, to be completed, and second node device is but not yet submitted, this When, distributed data base system is newly arrived a global read operation, and the data that first node device is submitted are read, but second A node device is submitted because not yet completing data, and its data is caused not to be read, and this inconsistent phenomenon is referred to as distributed Reading partly has been filed on exception (Distributed Read Committed-Committing anomaly, abbreviation DRCC), therefore, Current reading data cannot be guaranteed that the data read are in coherency state.
Summary of the invention
The present invention provides a kind of method for reading data, device, electronic equipment and storage mediums, can solve data reading The problem of consistency taken.Technical solution is as follows:
On the one hand, a kind of method for reading data is provided, which comprises
The first instruction message is sent to the corresponding multiple node devices of global read transaction, first instruction message is for referring to Show that the multiple node device stops carrying out the submission operation of global write affairs;
The relevant issues list of the multiple node device is received, the relevant issues list of each node device includes node The transaction status of ongoing correlation global write affairs and each related global write affairs in equipment, each correlation global write Affairs correspond at least two node devices in the multiple node device;
According to the relevant issues list of the multiple node device, the first global write transaction set is determined, described first is global Writing transaction status of the first global write affairs in corresponding node equipment included by transaction set includes being carrying out state and standard Standby submission state;
The first global write transaction set is sent to the multiple node device;
The first object data that the multiple node device returns are received, the first object data include based on described complete The data that office's read transaction and the first global write transaction set obtain.
On the one hand, a kind of method for reading data is provided, node device is applied to, which comprises
According to the first instruction message received, stop the submission operation for carrying out global write affairs, first instruction disappears Breath is used to indicate the submission operation that the corresponding multiple node devices of global read transaction stop carrying out global write affairs;
Relevant issues list is obtained, the relevant issues list includes ongoing related global on the node device The transaction status of affairs and each related global write affairs is write, each correlation global write affairs correspond to the multiple node and set At least two node devices in standby;
Send the relevant issues list;
The first global write transaction set is received, the first global write affairs included by the first global write transaction set are in correspondence Transaction status on node device includes the state that is carrying out and preparation submission state;
According to the first global write transaction set and the global read transaction, first object data, first mesh are exported Mark data include based on data acquired in the global read transaction and the first global write transaction set.
On the one hand, a kind of method for reading data is provided, which comprises
The second instruction message is sent to the corresponding multiple node devices of global read transaction, second instruction message is for referring to Show that the multiple node device returns to the relevant issues list of the global read transaction;
The relevant issues list of the multiple node device is received, the relevant issues list of each node device includes node The transaction status of ongoing correlation global write affairs and each related global write affairs in equipment, each correlation global write Affairs correspond at least two node devices in the multiple node device;
According to the relevant issues list of the multiple node device, the first global write transaction set and the second global write thing are determined Business group, transaction status of the first global write affairs in corresponding node equipment included by the first global write transaction set include It is carrying out state and prepares submission state, the second global write affairs included by the second global write transaction set are saved corresponding Transaction status on point device is to be carrying out state;
It is had been filed on when the first global write affairs in the first global write transaction set are in corresponding node equipment State sends the first global write transaction set and the second global write transaction set to the multiple node device;
The second target data that the multiple node device returns is received, second target data includes based on described complete The data that office's read transaction, the first global write transaction set and the second global write transaction set obtain.
On the one hand, a kind of method for reading data is provided, node device is applied to, which comprises
The second instruction message is received, multiple node devices that second instruction message is used to indicate global read transaction return Relevant issues list;
Relevant issues list is obtained, the relevant issues list of each node device includes to carry out on the node device Related global write affairs and each related global write affairs transaction status, each correlation global write affairs correspond to described At least two node devices in multiple node devices;
Send the relevant issues list;
The first global write transaction set and the second global write transaction set are received, included by the first global write transaction set Transaction status of the one global write affairs in corresponding node equipment is including being carrying out state and preparing submission state, and described second Transaction status of the second global write affairs in corresponding node equipment is to be carrying out state included by global write transaction set;
According to the first global write transaction set, the second global write transaction set and the global read transaction, output Second target data, second target data include based on the global read transaction, the first global write transaction set and The data that the second global write transaction set obtains.
On the one hand, a kind of reading data device is provided, described device includes:
Sending module, for sending the first instruction message to the corresponding multiple node devices of global read transaction, described first Instruction message is used to indicate the submission operation that the multiple node device stops carrying out global write affairs;
Receiving module, for receiving the relevant issues list of the multiple node device, the related thing of each node device Business list includes the transaction status of ongoing related global write affairs and each related global write affairs on node device, Each correlation global write affairs correspond at least two node devices in the multiple node device;
Determining module determines the first global write transaction set for the relevant issues list according to the multiple node device, Transaction status of the first global write affairs in corresponding node equipment included by the first global write transaction set includes Execution state and preparation submission state;
The sending module is also used to send the first global write transaction set to the multiple node device;
The receiving module is also used to receive the first object data that the multiple node device returns, first mesh Mark data include the data obtained based on the global read transaction and the first global write transaction set.
On the one hand, a kind of reading data device is provided, which includes:
Stopping modular, for according to the first instruction message received, stopping carrying out the submission operation of global write affairs, institute It states the first instruction message and is used to indicate the submission behaviour that the corresponding multiple node devices of global read transaction stop carrying out global write affairs Make;
Obtain module, for obtaining relevant issues list, the relevant issues list include on the node device The transaction status of the related global write affairs of progress and each related global write affairs, each correlation global write affairs correspond to At least two node devices in the multiple node device;
Sending module, for sending the relevant issues list;
Receiving module, for the first global write transaction set of reception, first is complete included by the first global write transaction set It includes the state that is carrying out and preparation submission state that transaction status of the affairs in corresponding node equipment is write by office;
Output module, for having been filed on state when the first global write affairs in the first global write transaction set are in, According to the first global write transaction set and the global read transaction, first object data, the first object data packet are exported It includes based on data acquired in the global read transaction and the first global write transaction set.
On the one hand, a kind of reading data device is provided, which includes:
Sending module, for sending the second instruction message to the corresponding multiple node devices of global read transaction, described second Instruction message is used to indicate the relevant issues list that the multiple node device returns to the global read transaction;
Receiving module, for receiving the relevant issues list of the multiple node device, the related thing of each node device Business list includes the transaction status of ongoing related global write affairs and each related global write affairs on node device, Each correlation global write affairs correspond at least two node devices in the multiple node device;
Determining module determines the first global write transaction set for the relevant issues list according to the multiple node device With the second global write transaction set, the first global write affairs included by the first global write transaction set are in corresponding node equipment Transaction status include the state that is carrying out and prepare submission state, second is global included by the second global write transaction set Writing transaction status of the affairs in corresponding node equipment is to be carrying out state;
The sending module is also used to when the first global write affairs in the first global write transaction set are in corresponding node It is in the state of having been filed in equipment, sends the first global write transaction set and described second entirely to the multiple node device Transaction set is write by office;
The receiving module is also used to receive the second target data that the multiple node device returns, second target Data include being obtained based on the global read transaction, the first global write transaction set and the second global write transaction set Data.
On the one hand, a kind of reading data device is provided, which includes:
Receiving module, for receiving the second instruction message, second instruction message is used to indicate the more of global read transaction A node device returns to relevant issues list;
Module is obtained, for obtaining relevant issues list, the relevant issues list of each node device includes the node The transaction status of ongoing correlation global write affairs and each related global write affairs in equipment, each correlation global write Affairs correspond at least two node devices in the multiple node device;
Sending module, for sending the relevant issues list;
The receiving module is also used to receive the first global write transaction set and the second global write transaction set, and described first is global Writing transaction status of the first global write affairs in corresponding node equipment included by transaction set includes being carrying out state and standard Standby submission state, affairs shape of the second global write affairs in corresponding node equipment included by the second global write transaction set State is to be carrying out state;
Output module, for having been filed on state when the first global write affairs in the first global write transaction set are in, According to the first global write transaction set, the second global write transaction set and the global read transaction, the second target is exported Data, second target data include based on the global read transaction, the first global write transaction set and described second The data that global write transaction set obtains.
On the one hand, a kind of electronic equipment is provided, which includes processor and memory, is stored in the memory There is at least one instruction, which is loaded by the processor and executed to realize as above-mentioned method for reading data is held Capable operation.
On the one hand, a kind of computer readable storage medium is provided, at least one instruction is stored in the storage medium, it should At least one instruction is loaded as processor and is executed to realize the operation as performed by above-mentioned method for reading data.
Method provided in an embodiment of the present invention, the overall situation in active state when being occurred by finding current global read transaction Affairs are write, to determine the global write affairs that may influence transaction consistency, that is to say and have found between multiple node devices, base In MVCC, common point with transaction consistency, based on the reading of such global write affairs, being equivalent to will be read Moment put off until one at the time of more postpone relative to current time on, can be regarded as a kind of process that delay is read, and In data read process, it may cause the inconsistent global write affairs of affairs due to eliminating, so that read data have Transaction consistency realizes the external data consistency of Database Systems.
Detailed description of the invention
Fig. 1 is a kind of implementation environment schematic diagram of method for reading data provided in an embodiment of the present invention;
Fig. 2 is a kind of method for reading data flow chart provided in an embodiment of the present invention;
Fig. 3 and Fig. 4 is respectively the comparison diagram of Transaction Identifier;
Fig. 5 is a kind of method for reading data flow chart provided in an embodiment of the present invention;
Fig. 6 is provided in a kind of Database Systems as the signaling interaction diagram between host and the node device of standby host;
Fig. 7 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention;
Fig. 9 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention;
Figure 10 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The present embodiments relate to database purchase have multiple tables of data, each tables of data can be used for storing tuple, Tuple can have one or more versions.Wherein, which can be for based on MVCC (Multi-Version Concurrency Control, Multi version concurrency control) any type of database.In embodiments of the present invention, to the number It is not especially limited according to the type in library.It should be noted that the data in above-mentioned database are based on status attribute, it may include three Kind state: current state, transition state and history state, three kinds of states are collectively referred to as " the full states of data ", referred to as full state data, full state number Each different conditions attribute in can be used for mark data state in which in its life cycle track.
Current state (Current State): the data of the latest edition of tuple are the data in the current generation.It is in The state of the data of current generation, referred to as current state.
Transition state (Transitional State): it is not that the newest version of tuple is also not history state version, is in During changing from current state to history state, the data in transition state, referred to as partly decline data.
History state (Historical state): the state of tuple in history, it is not current that value, which is old value, Value.The state of data in the historical stage, referred to as history state.The history state of one tuple, can have multiple, reflect data Status change process.Data in history state can only be read and cannot be modified or deleted.
It should be noted that above-mentioned three kinds of states of data exist under MVCC mechanism, and under non-MVCC mechanism, number According to history state and current state can be only existed.At MVCC or block Parallel access control mechanism, affairs submit after data New value is in current state.By taking MVCC mechanism as an example, the number of the affairs generation in current active transaction list before the smallest affairs According to state is in history state.In the case where blocking Parallel access control mechanism, after affairs are submitted, the value of the data before submission becomes The value of history state, the i.e. old value of tuple are in history state.And affairs (non-current correlation thing is still enlivened in the version being read Business) it is using, and since newest relevant issues have modified the value of tuple, latest value has been in a current state, is read To the relatively current state of value be in a historic state, therefore, data mode is between current state and history state, institute With referred to as transition state.
For example, the A account balance of User table is supplemented with money from 10 yuan becomes 20 yuan under MVCC mechanism, 15 yuan of changes have then been consumed It is 5 yuan, finance B mechanism reads data and checks during affairs carry out always at this time, and after A and supplements 20 yuan with money and become 25 yuan, then 25 Member is current state data, and reading 5 yuan of B are transition state, remaining two value 20,10 is the shape existed in history State is all history state data.
Fig. 1 is a kind of implementation environment schematic diagram of method for reading data provided in an embodiment of the present invention.Referring to Fig. 1, the Fig. 1 Provided implementation environment can be distributed data base system, may include gateway server, global transaction mark in the system Know and generate cluster and distributed storage cluster, wherein distributed storage cluster may include multiple node devices, and the distribution Formula storage cluster can use active and standby structure.In some embodiments, the gateway server can in distributed storage cluster Any one node device merge in the same physical machine, that is to say, allow some participate in read operation node device serve as net Close server.
Wherein, gateway server is used to receive read-write requests, and based on read transaction or write transaction corresponding to read-write requests Whether it is global transaction, is identified for the corresponding read transaction or write transaction of the read-write requests to global transaction and generate cluster application only One global transaction mark, to guarantee consistency of the reading and writing data in entire distributed data base system.
Global transaction mark generates cluster and identifies for generating global transaction, i.e. gxid, to identify global transaction, the overall situation Affairs can refer to the affairs of multiple node devices, such as global read transaction can be related to on multiple node devices The reading of storing data, in another example, global write affairs can be related to the data write-in on multiple node devices.And using makes The generation that global transaction mark is realized with the form of cluster, can prevent Single Point of Faliure.When there is global transaction generation It waits, can be identified by gateway server to the global transaction and generate one globally unique ident value of cluster application.Some In embodiment, global transaction mark generates cluster, and to can be physics independent, can also with distributed storage cluster (such as ZooKeeper it) is merged together, provides global global transaction mark to each gateway server and generate service.Above-mentioned Fig. 1 is only There is provided a kind of architecture diagrams of the distributing real time system of lightweight, are a type distributed data base systems.
Fig. 2 is a kind of flow chart of method for reading data provided in an embodiment of the present invention.Referring to fig. 2, this method comprises:
201, when read transaction is related to cross-node operation, which is determined as global read transaction by gateway server, Gateway server generates request to global transaction mark spanning set pocket transmission.
When gateway server receives any one action statement (such as SQL statement), gateway server is as database Advanced computation layer the action statement can be parsed, when the read transaction action statement carry nominal key when, should Gateway server determines that the read transaction is related to cross-node operation.For example, the nominal key can be " GLOBAL ", for referring to The reading object for showing the action statement includes all data in Database Systems, be that is to say all in covering Database Systems Node device thens follow the steps 201 then when including " GLOBAL " in the action statement.
Certainly, in some embodiments, whether the data of being read can also be determined according to the action statement of the read transaction On a node device, if it is determined that not on the same node device, it is determined that the read transaction is related to cross-node operation. Specifically, it according to the metadata in the range and the range of the action statement data of being read of the read transaction, determines Whether the data to be read are stored in more than two node devices, when the determining node device being stored in more than described two When, the read transaction is related to cross-node operation.Since the current storage equipment of data can be recorded in metadata.For example, net Closing server can be every action statement (SQL (Structured Query of each affairs according to metadata Language, structured query language)) determine accessed node device, record determined by node device, when count on by When the different number of node equipment of access are more than or equal to 2, that is, execute the step 201.In the above-described embodiments, this to be based on metadata Method of determination can be adapted for the SELECT statement of single sentence.
The above-mentioned process for determining whether to be related to cross-node operation can be summarized as identification based on nominal key and by The automatic identification of gateway server is then global transaction if there is cross-node operates (global transaction mark).And if operation language Sentence (such as SQL statement) pertains only to individual node equipment, then belongs to local affairs, also known as local matter, then complete without application Office's Transaction Identifier, the only affairs distribute local Transaction Identifier.
By taking nominal key is " GLOBAL " as an example, which can use following form:
BEGIN GLOBAL;//GLOBAL shows to start a global transaction, to " global gxid generates cluster " application one A globally unique global transaction ident value gxid
SELECT…
END;
202, after global transaction mark generation cluster receives generation request, global transaction is generated for the overall situation read transaction Global transaction mark is sent to the gateway server by mark.
In embodiments of the present invention, global transaction mark, which generates cluster global transaction mark generated, can be numerical value Type.
203, the global transaction is identified the Transaction Identifier as the overall situation read transaction by the gateway server.
For tuple, if supporting MVCC technology, one can be increased in the case where originally there is the domain xid in tuple Gxid, xid are renamed as lxid, and above-mentioned stylistic difference may refer to Fig. 3 and Fig. 4.The Transaction Identifier of local affairs and complete Office's Transaction Identifier can all be monotonic increase.
As an example it is assumed that affairs T needs to write two node devices, transfer operation is done, then its action statement can use Following form:
BEGIN GLOBAL;One global gxid of // application, it is assumed that be 20
UPDATE user_account SET my_wallet=my_wallet -10WHERE key=100;// node 1, local lxid are 18
UPDATE user_account SET my_wallet=my_wallet+10WHERE key=900;// node 2, local lxid are 22
COMMIT;
The tuple that key on node device 1 is 100, the Transaction Identifier in tuple is a binary group: gxid, Lxid }={ 20,18 }.
The tuple that key on node device 2 is 900, the Transaction Identifier in tuple is a binary group: gxid, Lxid }={ 20,22 }.
Pass through above-mentioned Transaction Identifier, so that it may which whether data of the identification from different node devices are the same global transactions Whether the data of operation belong to the same affairs.And if the next affairs of node device 1 are global transactions, affairs mark Knowing is { gxid, lxid }={ 21,19 };Next one affairs is local affairs, then Transaction Identifier be { gxid, lxid }=0, 20};Next one affairs is global transaction, then Transaction Identifier is { gxid, lxid }={ 22,21 }, and so on.
204, gateway server is according to the Transaction Identifier of the overall situation read transaction, to the corresponding multiple nodes of the overall situation read transaction Equipment sends the first instruction message, which is used to indicate multiple node device and stops carrying out global write affairs Submit operation.
It is inconsistent in order to avoid continuing to may cause data on each node device involved in global read transaction Affairs continue, which can decompose global read transaction, first related to node are required to stop it He submits operation by the global of affairs.
For distributed data base system, may have on each node device and enliven global write affairs, these If enlivening the submission of global write affairs, it is likely to occur the inconsistent situation of new data, therefore, can be carried out by gateway server Instruction, allows enlivening global write affairs and no longer can become preparing submission state from being carrying out state on each node device.When So, local matter can continue to submit.Wherein, it is carrying out state, indicates the affairs rank identified in distributed data base system Duan Shang does not enter into preparation presentation stage.Preparing submission state indicates that affairs come into presentation stage.
It should be noted that timeout mechanism can be set in gateway server, for example, appointing if had in multiple node device One node device time-out does not return to relevant issues list, then illustrates that the node device is likely to occur network problem or delay machine, Then the gateway server can send first instruction message to the node device or multiple node device again, each to guarantee A node device can stop the submission operation of global write affairs.Certainly, for saving signaling, the wasting of resources, Ke Yiwei are avoided Operation setting sending threshold value is retransmitted, such as will retry transmission operation setting is 3 times, when reaching the sending threshold value, still there is node Equipment does not return to relevant issues list, then the rollback overall situation read transaction.Wherein, rollback overall situation read transaction refers to Database Systems Be restored to the state that global read transaction starts, for example, Database Systems all based on the overall situation read transaction have been read or The data that person has exported all are set in vain.
First instruction message may include the Transaction Identifier of global read transaction and the node identification of multiple node devices, For example, the overall situation read transaction can be indicated with T-current, and node device involved in the T-current include N1, N3, N5,N9.The pattern that the node identification can use { N1, N3, N5, N9 } similar in this way, for indicating this global read transaction behaviour Work is related to these node devices.
It is to execute stopping by an instruction message to submit and transmit involved in global read transaction in above-described embodiment Node device, it is above-mentioned for executing the message and biography that stop submitting to achieve the purpose that saving signaling, and in some embodiments The message for passing node device involved in global read transaction can be two message, be divided to two transmissions, for example, gateway server is first It is sent to multiple node devices and stops submitting message, so that each node device stops the submission operation of global write affairs, the net Server is closed to send after receiving the stopping response of multiple node device, then to multiple node devices for transmitting global reading The message of node device involved in affairs enables each node device to be based on node involved in the overall situation read transaction and sets It is standby to return to relevant issues list.
Certainly, in any secondary message transmitting process of above-mentioned gateway server, timeout mechanism can be set, to avoid Influence the normal operation of Database Systems.
205, each node device in multiple node device stops carrying out complete according to the first instruction message received The submission operation of affairs is write by office, which is used to indicate the corresponding multiple node devices of global read transaction and stops carrying out The submission of global write affairs operates.
It, then can be to the determining node device after receiving the first instruction message for any one node device On enliven and write affairs (state that is carrying out either prepares submission state and writes affairs), according to each thing for actively writing affairs Business mark, identifies that this actively writes whether affairs are global write affairs, when it is global write affairs that any one, which actively writes affairs, then stops The submission operation of the only submission operation of the global write affairs, the stopping global write affairs refers to for any one global write affairs For, forbid the global write affairs to be converted to from the state of being carrying out and prepares submission state.
In some embodiments, it can also realize that the submission to global write affairs is operated using resource lock, for example, when section Point device receives the first instruction message, can carry out to the active corresponding resource of global write affairs on node device Lock, so that can not carry out write operation to the resource locked can release resource after obtaining relevant issues list It puts.In a kind of example, when locking, related resource lock can be mutex.
In some embodiments, if above-mentioned first instruction message is divided to two transmissions, which can received To after stopping submission message, operation is submitted in stopping, and returns to stopping response to gateway server, to inform gateway server certainly Oneself has stopped carrying out submission operation, further sends to be used to indicate to trigger gateway server and obtains relevant issues list Message, to trigger acquisition process.
206, each node device in multiple node device obtains relevant issues list, which includes The transaction status of ongoing correlation global write affairs and each related global write affairs on the node device, each correlation Global write affairs correspond at least two node devices in multiple node device.
Node device can be provided for gateway server on the node device it is ongoing correlation global write affairs and The transaction status of each correlation global write affairs.Relevant issues refer to: the node device that other global write affairs are related to is necessary Include by the node device that global read transaction is related to.Such as a global write affairs T9, write node device N1, N3, it is determined that Include and needs to be fed back to gateway server;And a global write affairs T10, node device N3, N7 are write, N7 is not in the overall situation The range of nodes that read transaction is related to then does not include not need node device N7 response proxy then at last.In relevant issues list Affairs, it is necessary to be to refer at least to corresponding at least two node device of the overall situation read transaction, for example, global read transaction is related to { N1, N3, N5, N9 }, then the related global write affairs of the overall situation read transaction need to be related to wherein at least two node device.
In embodiments of the present invention, optionally, which may include: to traverse on the node device just In the global write affairs of progress;When any one global write office corresponding node device include in multiple node device extremely Few two node devices, write affairs for this and are added to the relevant issues list.
The relevant issues list can carry in the response that node device is returned to gateway server.Certainly, in order to allow Each node device knows which has write affairs on this node device may affect the consistency of global read transaction, each overall situation Affairs are write to be also required to the node device for being related to this affairs and be equally handed down to each node device for being related to this affairs to know.Such as The global write affairs of oneself, which pertain only to N1, N3, to be known for global write affairs T9, N1, and the two node devices are read in the overall situation Within the scope of the node device that affairs are related to, therefore, using the information of global write affairs T9 as response content.Such as global write thing Be engaged in T10, and N3 knows that oneself global write affairs pertain only to N1, N7, and the node device model that N7 is not related in the overall situation read transaction In enclosing, therefore not using the information of global write affairs T10 as response content.
Further, if node device involved in global write affairs is not multiple sections that above-mentioned global read transaction is related to The subset of point device, then the global write affairs are also not the related global write affairs of the overall situation read transaction, then can not this is complete The information of affairs is write as response content by office.
Optionally, the relevant issues list that node device is returned to gateway server can be with are as follows: the node mark of node device The Transaction Identifier and transaction status of knowledge and each global write affairs, such as:
The relevant issues list of N1: { N1, { gxid2- prepares submission state, and gxid5- is carrying out state, and gxid9- is just In the state of execution } }
The relevant issues list of N3: { N3, { gxid2- is carrying out state, and gxid5- is carrying out state, and gxid9- is quasi- Standby submission state } }
The relevant issues list of N5: { N5, { gxid2- prepares submission state, and gxid5- is carrying out state } }
The relevant issues list of N9: { N9, { gxid5- is carrying out state } }
In some embodiments, if above-mentioned first instruction message is sent in two times, which can received To after stopping submission message, operation is submitted in stopping, and returns to stopping response to gateway server, to inform gateway server certainly Oneself has stopped carrying out submission operation.And the node device is being received for transmitting node device involved in global read transaction Message, enable each node device returned based on node device involved in the overall situation read transaction relevant issues column Table.
207, each node device in multiple node device sends the relevant issues list.
In step 207, global write affairs are prohibited since each node device has been based on the first instruction message Therefore the process only submitted has had sent relevant issues list to gateway server in each node device, it can restore The submission of global write affairs operates, and that is to say, for node N1, can continue complete after having sent relevant issues list The submission operation of affairs is write by office, and allowing to be carrying out state becomes preparing submission state, even becomes having been filed on state (Committed)。
208, after the gateway server receives the relevant issues list of multiple node device, according to multiple node device Relevant issues list, determine the first global write transaction set.
Wherein, affairs shape of the first global write affairs in corresponding node equipment included by the first global write transaction set State includes the state that is carrying out and prepares submission state, be that is to say, for any one first global write affairs, in correspondence Node device on transaction status it is existing be carrying out state there are also prepare submission state.If in the first global write transaction set The subsequent submission of affairs, then may cause it is new inconsistent, therefore, can transaction journal to the type at one group, this first Affairs in global write transaction set, which are equally possible, generates inconsistent affairs, can submit in this partial transaction subsequently through control It completes, then the version that these offices correspond to tuple is incorporated within read range, to avoid the inconsistent situation of data.
In embodiments of the present invention, the step 208 may include: from the relevant issues list of multiple node device, It, will when transaction status of any global write affairs in corresponding node equipment includes the state that is carrying out and prepare submission state The affairs are added to the first global write transaction set as the first global write affairs.
In a kind of possible embodiment, when any one transaction status of global write affairs in corresponding node equipment includes When being carrying out state and preparing submission state, gateway server can notify the corresponding node device of the global write affairs to restore Submission operation to the global write affairs has been filed on state when the global write affairs are on node device, then by the overall situation Affairs are write as the first global write affairs and are added to the first global write transaction set.For each overall situation in relevant issues list The process that above-mentioned control is submitted can be executed by writing affairs, to obtain each first global write affairs.
In alternatively possible embodiment, each first global write affairs in the first global write transaction set are being determined Afterwards, gateway server can notify the corresponding node device of each first global write affairs to restore the submission to the global write affairs Operation has been filed on state when each first global write affairs are on node device, then can execute the hair of following step 209 Pass through journey.
It, then can be in the section when message is submitted in the recovery for receiving gateway server transmission for node device The submission for restoring to carry out global write affairs on point device operates, and has been filed on state when the global write affairs are in, then can be to net It closes server return and has been filed on response, so that gateway server knows that this has been filed on state.Certainly, node device is come It says, recovery can also be notified without gateway server, it, then can be with but after obtaining and having sent relevant issues list Restore to submit operation, and when node device executes reading data, it only needs above-mentioned global write affairs to be in and has been filed on shape State.
And for the affairs other than the first global write transaction set, then it can also notify it is replied to carry out global write affairs Submission operation or by node device voluntarily restores submit operate, it is not limited in the embodiment of the present invention.
For the transaction status on the more specific above-mentioned node device of expression, referring to the following table 1, which illustrates that node is set Standby the case where executing global transaction table.
Table 1
Gxid2 affairs Gxid5 affairs Gxid9 affairs Gxid10 affairs
N1 Prepare submission state It is carrying out state It is carrying out state
N3 It is carrying out state It is carrying out state Prepare submission state It is carrying out state
N5 Prepare submission state It is carrying out state
N9 It is carrying out state
N7 Prepare submission state
It based on the example of above-mentioned table 1, can know, for the global write affairs on node device, can there is following four feelings Condition:
Situation 1, the subtransaction of global write affairs is on each node device prepares submission state;
The subtransaction of situation 2, global write affairs is in the state of being carrying out on each node device, shows thing this moment Business do not enter into presentation stage then and not will cause it is distributed read it is inconsistent;
Situation 3, the subtransaction of global write affairs on each node device at least one be in be carrying out state and One in preparation submission state;
Situation 4, the subtransaction of global write affairs is not on each node device to be prepared submission state and is holding Row state, i.e., no global write affairs are carrying out.Since the acquisition that such case has passed through relevant issues list excludes, Therefore gateway server will not be supplied to as response content.
Based on the above situation 1 to 3, gateway server can traverse each related global write affairs, the gxid2 of table 1 as above, Gxid5, gxid9 filter out the corresponding global write affairs of situation 2, without any processing, due to right in the aforementioned embodiment The global write affairs of situation 2, which forbid submitting, to be operated, and therefore, not will cause new inconsistence problems.
The first global transaction group can be a Transaction Identifier set, can be regarded as constructing a snapshot (PostgreSQL becomes SanpShot, and MySQL/InnoDB is known as ReadView), this snapshot be equivalent to have registered it is all Current active global write affairs are subsequent to be based on this list and tuple visibility judge, so that it may to confirm quilt to a list Whether the tuple read is version that the office submitted relative to this affairs was write, if it is, as it can be seen that guaranteeing in this way The read consistency of single machine.
209, the gateway server sends the first global write transaction set to multiple node device.
Since actual read is completed by node device, gateway server is needed the first global write affairs Group is sent to node device, to carry out visibility judge by node device, to realize the reading of data.
210, it after each node device in multiple node device receives the first global write transaction set, is read according to the overall situation The transaction snapshot of affairs exports the first tuple in the target tuple of the overall situation read transaction, which is for the overall situation The visible tuple of read transaction.
It finishes, that is to say when all global write affairs comprising preparing submission state are carried out by each node device, For each node device, the first global write affairs of each of the first global write transaction set are on the node device In the state that has been filed on, then the node device, which can determine, executes subsequent data visibility deterministic process, to carry out actual number According to reading.
For the overall situation read transaction, multiple versions of tuple can be judged by the transaction snapshot of the overall situation read transaction This whether it is seen, for example, according to the establishment moment of the establishment moment of the transaction snapshot of the overall situation read transaction and tuple, deletion when It carves or submits the moment, to judge whether the tuple is visible.Specifically, the present embodiments relate to tuple whether as it can be seen that referring to Whether tuple moment corresponding to the transaction snapshot of global read transaction can be read by office.It is every from tables of data to read one Tuple, can read the life cycle information of the tuple, that is to say the establishment moment of the tuple, delete the moment and should The information such as the submission moment of tuple, for it that is to say the visibility judge of establishment moment of transaction snapshot based on the historical juncture:
(1): when a certain version of the tuple is insertion operation generation, when the establishment moment and submission moment are in the thing Before the initial time of the establishment moment of business snapshot, determine that the tuple is visible.
(2): when a certain version of the tuple is delete operation generation, when the deletion moment and submission moment are in the thing It is engaged in front of the establishment moment of snapshot, determines that the tuple is visible.
(3): when a certain version of the tuple generates to update operation, when the establishment moment and submission moment are in the thing It is engaged in front of the establishment moment of snapshot, determines that the tuple is visible.
If 211, the node device determines to include the second tuple in the target tuple of global read transaction, and submit this second The affairs of tuple are any one first global write affairs, export second tuple, which is for the overall situation read transaction Sightless tuple.
In the visibility judge of step 210, when there is some version of any one tuple invisible for global read transaction, It that is to say when being unsatisfactory for visibility condition then can also further judge whether the affairs of the submission version are the first global write The first global write affairs in transaction set are back to gateway server if it is, also obtaining the tuple of the version.
In above process, which has been completed submission when node device starts and reads, therefore, This partial data has been filed on the state that a part is not submitted there is no a part, would not also cause the inconsistent of reading, and Due to eliminating the phase of the global write affairs in the 2nd kind of situation entirely in the state that is carrying out in the reading process of node device Close data, therefore, also would not there are the related datas of affairs occur described above distributed reading partly to have been filed on exception Phenomenon ensure that the consistency of reading data.
For example, having, although any tuple is invisible for global read transaction, which is by this affairs of gxid2 It submits, and gxid2 then exports the tuple in the first global write transaction set.
The first global write transaction set and the overall situation read transaction according to above-mentioned steps 210 to 211, export first object number According to the first object data include based on data acquired in the overall situation read transaction and the first global write transaction set.
212, each node device in multiple node device sends the first object got to the gateway server Data.
213, the gateway server exports the first object data received.
For each node device, can according in the first global write transaction set received affairs and this is complete Office's read transaction, to obtain visual data, thus for global read transaction output data.In a kind of possible implementation, gateway clothes Business device can export the data got, another in the first object data for receiving any one node device and being returned In a kind of possible implementation, gateway server can also be in the first object data for receiving all node devices and being returned Afterwards, then the data got are exported, it is not limited in the embodiment of the present invention.
Method provided in an embodiment of the present invention, the overall situation in active state when being occurred by finding current global read transaction Affairs are write, to determine the global write affairs that may influence transaction consistency, that is to say and have found between multiple node devices, base In MVCC, common point with transaction consistency, based on the reading of such global write affairs, being equivalent to will be read Moment put off until one at the time of more postpone relative to current time on, can be regarded as a kind of process that delay is read, and In data read process, it may cause the inconsistent global write affairs of affairs due to eliminating, so that read data have Transaction consistency realizes the external data consistency of Database Systems.Due to during carrying out delay reading, by complete The analysis of global write affairs is enlivened involved in office's read transaction on each node device, so as to may cause data different by some The global write transaction set of cause is used in subsequent node device reading process at transaction set, can exclude to may result in data Inconsistent situation guarantees that the data read are in coherency state, realizes the external data consistency of Database Systems.
Above-described embodiment be based on to submit operation forbid and restore determine the first global write transaction set, then be based on the One global write transaction set, in order to improve concurrency, is avoided due to forbidding submitting to obtain the embodiment of tuple in some embodiments And the obstruction that may cause, it can also forbid without submission, but by determining the first global write transaction set and second entirely The mode of transaction set is write by office, to determine some affairs that data can be caused inconsistent and the thing that data will not be caused inconsistent Business, then it is based on the first global write transaction set and the second global write transaction set, to obtain tuple, referring to Fig. 5, which be can wrap Include following steps:
501, when read transaction is related to cross-node operation, which is determined as global read transaction by gateway server, Gateway server generates request to global transaction mark spanning set pocket transmission.
502, after global transaction mark generation cluster receives generation request, global transaction is generated for the overall situation read transaction Global transaction mark is sent to the gateway server by mark.
503, the gateway server identifies the global transaction and the local Transaction Identifier of the read transaction is read as the overall situation The Transaction Identifier of affairs.
Similarly to 203, this will not be repeated here for above-mentioned steps 501 to 503 and step 201.
504, gateway server sends the second instruction message to the corresponding multiple node devices of the overall situation read transaction, this second Instruction message is used to indicate the relevant issues list that multiple node device returns to the overall situation read transaction.
Second instruction message may include the Transaction Identifier of global read transaction and the node identification of multiple node devices. The relevant issues list of each node device includes ongoing related global write affairs and each correlation on node device The transaction status of global write affairs, each correlation global write affairs correspond at least two nodes in the multiple node device and set It is standby.
505, each node device in multiple node device obtains related thing according to the second instruction message received Business list, the relevant issues list include ongoing related global write affairs and each related overall situation on the node device The transaction status of affairs is write, each correlation global write affairs correspond at least two node devices in multiple node device.
Similarly, this will not be repeated here for the step 505 and step 206.
506, each node device in multiple node device sends the relevant issues list.
507, it after the gateway server receives the relevant issues list of multiple node device, is set according to the multiple node Standby relevant issues list determines the first global write transaction set and the second global write transaction set.
Wherein, affairs shape of the first global write affairs in corresponding node equipment included by the first global write transaction set State includes the state that is carrying out and prepares submission state, and the second global write affairs included by the second global write transaction set are right Answering the transaction status on node device is to be carrying out state.
Optionally, which may include following step 507A to 507B:
507A: from the relevant issues list of multiple node device, when affairs shape of any affairs in corresponding node When state includes the state that is carrying out and prepares submission state, first overall situation is added to using the affairs as the first global write affairs Write transaction set.
Similarly, this will not be repeated here for the process and above-mentioned steps 208.
507B: from the relevant issues list of multiple node device, when affairs shape of any affairs in corresponding node State is to be added to the second global write transaction set for the affairs as the second global write affairs when being carrying out state.
If the subsequent submission of affairs in the second global write transaction set, may cause it is new inconsistent, therefore, Ke Yiye To the transaction journal of the type at one group, the affairs in the second global write transaction set, which are equally possible, generates inconsistent affairs, It can be excluded except reading in the subsequent version that these offices are corresponded to tuple, to avoid the inconsistent situation of data.It should Second global write transaction set can be regarded as the invisible set of tuple.For example, based on example provided by above-mentioned table 1, feelings Affairs involved in condition 2 belong to the second global write transaction set.
It should be noted that above-mentioned steps 507A and 507B can be carried out parallel, or carry out according to any sequencing, It is not limited in the embodiment of the present invention.
508, the first global write transaction set and the second global write transaction set are sent to multiple section by the gateway server Point device.
509, node device is according to the first global write transaction set, the second global write transaction set and the overall situation Read transaction, exports the second target data, and second target data includes based on the global read transaction, first global write The data that transaction set and the second global write transaction set obtain.
It finishes, that is to say, first when all global write affairs comprising preparing submission state are carried out by node device Global write affairs have been in when having been filed on state, then can determine and execute subsequent data visibility deterministic process, to carry out reality The reading data on border.Wherein, global write affairs are in and have been filed on state and refer to the global write affairs on each node device Transaction status is to have been filed on state.
Specifically, which includes: to export the global read transaction according to the transaction snapshot of the global read transaction Target tuple in the first tuple, first tuple is for the global visible tuple of read transaction;If described complete It include the second tuple in the target tuple of office's read transaction, and submitting the affairs of second tuple is any one first global write thing Business, exports second tuple, and second tuple is for the sightless tuple of the global read transaction;If the overall situation It include the second tuple in the target tuple of read transaction, and submitting the affairs of second tuple is any one second global write thing Business, ignores second tuple.
Above-mentioned acquisition data procedures are mainly in conjunction with MVCC visibility judge and the transaction set of two different purposes It determines, for being unsatisfactory for the tuple version of visibility condition, is generated if it is some affairs in the first global write transaction set Data, then, it is seen that.It is but if being the data that some affairs in the second global write transaction set generate, then invisible.
In above process, which has been completed submission when node device starts and reads, therefore, This partial data has been filed on the state that a part is not submitted there is no a part, would not also cause the inconsistent of reading, and Due to there is no mentioning for the affairs for being in the state of being carrying out in control situation 2 on each node device in whole flow process It hands over, therefore, it is necessary to exclude this partial transaction in the reading process of node device, that is to say caused by the second global write affairs Related data, therefore, the data of data read process and the second global write transaction set based on the first global write transaction set exclude Process can exclude the data for influencing data consistency while guaranteeing that exported data are with uniformity.
In above-mentioned steps 501 to 509, the submission of affairs will not be forbidden, it is subsequent also just not have to lift a ban affairs submission, not only The amount of interaction for reducing signaling, also improves concurrency.
510, node device sends the second target data got to the gateway server.
511, the gateway server exports the second target data received.
For each node device, can according in the first global write transaction set received affairs and this is complete Office's read transaction, to obtain visual data, thus for global read transaction output data.In a kind of possible implementation, gateway clothes Business device can export the data got, another in the second target data for receiving any one node device and being returned In a kind of possible implementation, gateway server can also be in the second target data for receiving all node devices and being returned Afterwards, then the data got are exported, it is not limited in the embodiment of the present invention.
Certainly, in any secondary message transmitting process of above-mentioned gateway server, timeout mechanism can be set, to avoid Influence the normal operation of Database Systems.In some embodiments, for the global read transaction for pertaining only to a read transaction, such as Fruit appoints primary information transmission process that time-out occurs, can also be without rollback, for example, for only read transaction, gateway server can To obtain GTID (Global TransactionID, a global transaction identifier) value since new, then it is distributed to each Node device, each node device rebuild the first global transaction group, to carry out read-only operation.This mechanism avoids read-only The rolling back action of affairs can improve the transaction throughput of system, especially have to reading frequent application scenarios more in HTAP system Effect.
Method provided in an embodiment of the present invention can also support multiple global read transactions concurrently to execute.For example, when multiple complete Time interval between office's read transaction is less than prefixed time interval (in such as 1 second, can be used as parameter setting), and read node Equipment is identical or inclusion relation (such as the previous global read range of nodes of read transaction includes the latter overall situation read transaction Reading node device range), then allow the latter overall situation read transaction to be multiplexed the first of previous global read transaction and global read thing It is at least one set of in business group and the second global read transaction group, to further increase overall performance.
Method provided in an embodiment of the present invention, the overall situation in active state when being occurred by finding current global read transaction Affairs are write, to determine the global write affairs that may influence transaction consistency, that is to say and have found between multiple node devices, base In MVCC, common point with transaction consistency, based on the reading of such global write affairs, being equivalent to will be read Moment put off until one at the time of more postpone relative to current time on, can be regarded as a kind of process that delay is read, and In data read process, it may cause the inconsistent global write affairs of affairs due to eliminating, so that read data have Transaction consistency realizes the external data consistency of Database Systems.
Further, system architecture involved in the embodiment of the present invention provides one kind and provides for distributed data base system A light weight, the Transaction Processing of decentralization, wherein light weight characteristics exhibit is to have used global transaction mark life At cluster, the clustering functionality is single, Mass production global transaction can identify in memory, ultrahigh in efficiency.It is realized relative to one Global transaction management, conflict access control, MVCC mechanism global transaction manager for, performance advantage is particularly evident.It goes What the processing that centralization embodies the affairs being in the system was relied on is each node device, rather than global transaction management Device, therefore, the global transaction manager time-consuming there is no single-point, complicated in framework, to realize in complete function base Decentralization on plinth.
Further, the embodiment of the present invention can also ensure that distributed data base system realizes the characteristic of external consistency, That is to say, event in distributed data base occurs, obtain the order that data need to occur by event, and in the database by When consulting data, original event order can be still embodied.And cluster is generated as class TDSQL system since global transaction identifies Globally unique, monotonic increase logical time mark is provided, external consistency can be effectively ensured.It is i.e. global to read thing New affairs after business, even if affairs are submitted prior to global read transaction, but its data is still invisible for global read transaction.Again Person, it is logically a single-point that global transaction mark, which generates cluster, physically primary copy, from copy can but provide clothes Business, so global transaction mark generates cluster and becomes the chance reduction of performance bottleneck.
The embodiment of the present invention is suitable for distributed data base (SQL, NoSQL, NewSQL, relationship type, non-relational), is based on Any of systems such as the relevant database of MVCC, the non-relational database based on MVCC, distributed big data processing etc. Hold the transactional database system of the global write operation of cross-node.Further, the embodiment of the present invention is particularly suitable for building point The HTAP database of cloth, especially magnanimity tense distribution HTAP (Hybird Transactional/Analytical Processing, issued transaction/online analysis and processing) database.Since the embodiment of the present invention is distributed transaction, analytic type number It lightens the burden according to the framework in library in transaction processing facility level, so that transaction processing facility is simple and efficient.And use the single machine number of MVCC Baseline according to library system as each node cooperates decentralization, light weight transaction processing facility so that concurrent inquiry by The limitation arrived is less, and inquiry operation is autonomous between each node, thus is very suitable for analysis system use.To sum up institute It states, the embodiment of the present invention provides possibility for the high-performance of distributed mixed type (affairs, analytic type) database, in distributed number According to the framework level in library, the technical advantage of the performance boost of whole system is obvious.
The Database Systems of MVCC technology are realized for single machine, different implementations has one to the embodiment of the present invention Fixing is rung.For example, the Parallel access control technology of data realizes under the scene of serializability, for depending on TO (timestamp) For the database of+MVCC, such as PostgreSQL, using SSI (spring struts ibatis), technology be ensure that go here and there Rowization, due to being also MVCC technology on SSI technological essence, regardless of under which isolation level, the embodiment of the present invention is provided Method for reading data can be applicable in.Certainly, the isolation level that the affairs of cross-node are arranged on each node device needs to protect It holds consistent.And for the database for relying on the technology based on block, such as MySQL/InnoDB, RR is realized using MVCC (Repeatable Read, repeatable read isolation level) and RC (Read_Committed, reading have been filed on isolation level), this hair The method for reading data that bright embodiment provides can be applicable in.Certainly, the isolation level that the affairs of cross-node are arranged on each node It is not also required to be consistent.And for the database using SI isolation method, the embodiment of the present invention is equally applicable.
It should be noted that above-mentioned method for reading data can be applied in redundancy technique, when executing global backup, need The object to be read is all node devices in cluster, in such cases, the data reading mode may suspend it is all just It is submitted in the affairs of writing of execution, (time is theoretically shorter relative to global transaction manager).But new affairs are not influenced Starting, operation do not influence all subtransactions being carrying out in the distribution for being carrying out state phase and write affairs.And for The backup of the non-overall situation, since the number of nodes being related to is limited, the influence to Database Systems is smaller;It is provided using the embodiment of the present invention Method, the "bottleneck" of global transaction is eliminated from framework, can fundamentally improve the affairs of system entirety by a relatively large margin Handling capacity, and since the submission operation bring performance loss of pause part global write affairs is actually very small, it will not influence Overall performance not will cause the mutual obstruction of read-write operation.
In some embodiments, heartbeat can be kept between node device, once the node device for thering is any one to be read Situations such as delay machine occurs, and reading can not be replied, then it can be reported to gateway server, transaction rollback is responsible for by gateway server Release forbids writing continue to execute Deng ban, handles and writes the affairs events such as unsuccessfully).And if some node devices have been completed son Affairs, the then data invalid that user can be notified to return, certainly, for the mechanism that centralization returns the result, then in any node Equipment will not be exported as a result, being also just not necessarily to carry out the above-mentioned notice to user to user when a situation arises.
In some embodiments, there may be different active and standby frameworks for each node cluster, and are executing global reading thing When business, it can be carried out based on different active and standby frameworks, the preferential reading object of the overall situation read transaction is the section for being stored with primary copy Point device.And based on different active and standby frameworks, the application of method provided in an embodiment of the present invention can have different be applicable in:
First way is by principal and subordinate's logic copy technology, Lai Shixian high reliability, if the leader follower replication of MySQL is to make With the logic copy of binglog.For first way, first occurred on the node device of primary copy because writing affairs, from The purpose of copy only backup and read-only service, therefore, using read method provided in an embodiment of the present invention host (namely It is the node device for storing primary copy) carry out read operation, it can be ensured that the transaction consistency that the overall situation is read.With the master of MySQL For reproduction technology, due to its leader follower replication mechanism, it is possible to which will lead to that is to say in standby host for storing the section from copy Point device) on, the SQL statement of user is merely re-executed, and since Transaction Identifier is that each database engine distributes automatically, it can Primary copy and the difference of the Transaction Identifier from copy in tuple can be will cause, for this purpose, can carry out between host and standby host certain Signalling exchange, handed over for example, Fig. 6 is provided in a kind of Database Systems as the signaling between host and the node device of standby host Mutually figure, it is shown in Figure 6, the above method can also include: when in the database of active and standby structure use principal and subordinate's logic copy technology When, when standby host receives the operational order of the global transaction of host transmitting, identified according to the global transaction of the global transaction Assignment is carried out to the Transaction Identifier for executing affairs on the standby host.Wherein, which can be with can also for global read transaction Think global write affairs, it is not limited in the embodiment of the present invention.For example, when host generates binglog, for each Affairs, can transmit { gxid, the lxid } of global transaction to standby host, and standby host receives { gxid, lxid } and executes in binglog When SQL statement, for gxid and lxid { gxid, lxid } assignment received of each affairs.Such as the following table 2, MySQL is provided The improved contrast table of Binlog format.
Table 2
It with upper type, solves the problems, such as the global read consistency under logic copy framework, but also is able to solve for appointing Global in the case of a kind of cross-node affairs (such as main, active and standby, standby combination) reads Data Consistency.For example, global The data that read transaction is read do not influence to generate the host in distributed data base system so all from reserve system, whole Performance is high.
The second way is principal and subordinate's physical copy technology, and Lai Shixian high reliability such as uses the physics of REDO log (Log) Duplication, for example, the stream reproduction technology of PostgreSQL is exactly the physical copy technology by REDO Log.For second of side Formula that is to say the mode of physical copy, because tuple is the other duplication of physical level, will not lose the Transaction Identifier of tuple, But the organizational form of the data of different its multi version of database is different, the process for causing it to restore may be different.Typically Mode has the following two kinds:
Class PostgreSQL mode: the characteristics of such mode, it is that multi-edition data is stored in the page (PAGE), uses When REDO mode is restored, standby host is had been restored to, so reading the historical data of " dirty " can be successfully read, it will not Influence the application of the method for reading data of the embodiment of the present invention.
Class MySQL/InnoDB mode: being that multi-edition data is stored in the roll-back segment of memory the characteristics of such mode.Base It does and restores in RODO log, lack the information of roll-back segment and restored simultaneously in standby host, for this purpose, can the information of roll-back segment is also same It walks standby host (such as rollback segment information charges to REDO Log, carries out memory recovery according to the rollback segment information of record when recovery), and When implementing read method provided in an embodiment of the present invention, the current state data and the standby host stored in the standby host are read Transition state data in rollback segment information also avoid to cause shadow to the application of the method for reading data of the embodiment of the present invention It rings.
The third mode is that the data consistency of more copies of logic or physics is realized by distributed consensus agreement, To realize high reliability, the highly reliable system such as constructed with Paxos, Raft distributed consistency protocol.For the third side Formula, can distinguish the mode of logic and the mode of physics, specifically may refer to the place of above-mentioned first way and the second way Reason.
Fig. 7 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention, referring to fig. 4, the device packet It includes:
Sending module 701, for sending the first instruction message to the corresponding multiple node devices of global read transaction, described the One instruction message is used to indicate the submission operation that the multiple node device stops carrying out global write affairs;
Receiving module 702, for receiving the relevant issues list of the multiple node device, the correlation of each node device Transaction list includes the affairs shape of ongoing related global write affairs and each related global write affairs on node device State, each correlation global write affairs correspond at least two node devices in the multiple node device;
Determining module 703 determines the first global write affairs for the relevant issues list according to the multiple node device Group, transaction status of the first global write affairs in corresponding node equipment included by the first global write transaction set include just In the state of execution and prepare submission state;
The sending module 701 is also used to send the first global write transaction set to the multiple node device;
The receiving module 702, is also used to receive the first object data that the multiple node device returns, and described first Target data includes the data obtained based on the global read transaction and the first global write transaction set.
In a kind of possible embodiment, the determining module is used for:
From the relevant issues list of the multiple node device, when affairs shape of any affairs in corresponding node equipment When state includes the state that is carrying out and prepares submission state, described first is added to using the affairs as the first global write affairs Global write transaction set.
In a kind of possible embodiment, described device further include:
Global transaction identifier acquisition module, for will when any read transaction be related to cross-node operation when, by the reading thing Business is determined as global read transaction, obtains global transaction mark for the global read transaction.
In a kind of possible embodiment, the global transaction identifier acquisition module is used to identify spanning set to global transaction Pocket transmission generates request;It receives the global transaction mark and generates the global transaction mark that cluster is returned, by the global transaction Identify the Transaction Identifier as the overall situation read transaction.
In a kind of possible embodiment, when the action statement of the read transaction carries nominal key, described in determination Read transaction is related to cross-node operation;
According to the metadata in the range and the range of the action statement data of being read of the read transaction, determine Whether the data to be read are stored in more than two node devices, when the determining node device being stored in more than described two When, determine that the read transaction is related to cross-node operation.
In a kind of possible embodiment, described device further include:
When using principal and subordinate's logic copy technology in the database of active and standby structure, the overall situation of host transmitting is received in standby host When the operational order of affairs, according to the global transaction of global transaction mark to the Transaction Identifier for executing affairs on the standby host Carry out assignment;
When using principal and subordinate's physical copy technology in the database of active and standby structure, read based on the global read transaction During taking, the transition state number in the rollback segment information of the current state data and the standby host that store in the standby host is read According to.
In a kind of possible embodiment, described device further include:
Roll-back module, for when at least one node device for not receiving the multiple node device in target duration Response when, overall situation read transaction described in rollback.
All the above alternatives can form the alternative embodiment of the disclosure, herein no longer using any combination It repeats one by one.
It should be understood that reading data device provided by the above embodiment is in reading data, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, reading data device provided by the above embodiment and method for reading data embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Fig. 8 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention, referring to Fig. 8, the device packet It includes:
Stopping modular 801, for according to the first instruction message received, stopping carrying out the submission behaviour of global write affairs Make, first instruction message is used to indicate the corresponding multiple node devices of global read transaction and stops carrying out mentioning for global write affairs Hand over operation;
Obtain module 802, for obtaining relevant issues list, the relevant issues list include on the node device just In the related global write affairs of progress and the transaction status of each related global write affairs, each correlation global write affairs are corresponding At least two node devices in the multiple node device;
Sending module 803, for sending the relevant issues list;
Receiving module 804, for receiving the first global write transaction set, first included by the first global write transaction set Transaction status of the global write affairs in corresponding node equipment includes the state that is carrying out and preparation submission state;
Output module 805, for having been filed on shape when the first global write affairs in the first global write transaction set are in State exports first object data, the first object data according to the first global write transaction set and the global read transaction Including based on data acquired in the global read transaction and the first global write transaction set.
In a kind of possible embodiment, the acquisition module is used for: being traversed ongoing complete on the node device Affairs are write by office;When any one global write office, corresponding node device includes at least two sections in the multiple node device The affairs of writing are added to the relevant issues list by point device.
In a kind of possible embodiment, the output module is used for the transaction snapshot according to the global read transaction, defeated Corresponding first tuple of the global read transaction, first tuple are the visible version of target tuple out;
If the target tuple includes the second tuple, and submitting the affairs of second tuple is any one first overall situation Affairs are write, second tuple is exported, second tuple is the invisible version of the target tuple.
It should be understood that reading data device provided by the above embodiment is in reading data, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, reading data device provided by the above embodiment and method for reading data embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Fig. 9 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention, referring to Fig. 9, the device packet It includes:
Sending module 901, for sending the second instruction message to the corresponding multiple node devices of global read transaction, described the Two instruction messages are used to indicate the relevant issues list that the multiple node device returns to the global read transaction;
Receiving module 902, for receiving the relevant issues list of the multiple node device, the correlation of each node device Transaction list includes the affairs shape of ongoing related global write affairs and each related global write affairs on node device State, each correlation global write affairs correspond at least two node devices in the multiple node device;
Determining module 903 determines the first global write affairs for the relevant issues list according to the multiple node device Group and the second global write transaction set, the first global write affairs included by the first global write transaction set are in corresponding node equipment On transaction status include the state that is carrying out and prepare submission state, second is complete included by the second global write transaction set It is to be carrying out state that transaction status of the affairs in corresponding node equipment is write by office;
The sending module 901 is also used to save when the first global write affairs in the first global write transaction set corresponding It is in the state of having been filed on point device, sends the first global write transaction set and described second to the multiple node device Global write transaction set;
The receiving module 902 is also used to receive the second target data that the multiple node device returns, and described second Target data includes being obtained based on the global read transaction, the first global write transaction set and the second global write transaction set The data taken.
In a kind of possible embodiment,
The determining module is used for from the relevant issues list of the multiple node device, if any global write affairs exist Transaction status in corresponding node equipment includes the state that is carrying out and prepares submission state, using the global write affairs as the One global write affairs are added to the first global write transaction set;From the relevant issues list of the multiple node device, if Transaction status of any global write affairs in corresponding node equipment is to be carrying out state, using the global write affairs as Second global write affairs are added to the second global write transaction set.
It should be understood that reading data device provided by the above embodiment is in reading data, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, reading data device provided by the above embodiment and method for reading data embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Figure 10 is a kind of structural schematic diagram of reading data device provided in an embodiment of the present invention, referring to Figure 10, the device Include:
Receiving module 1001, for receiving the second instruction message, second instruction message is used to indicate global read transaction Multiple node devices return relevant issues list;
Module 1002 is obtained, for obtaining relevant issues list, the relevant issues list of each node device includes described The transaction status of ongoing correlation global write affairs and each related global write affairs on node device is each related complete Affairs are write corresponding at least two node devices in the multiple node device by office;
Sending module 1003, for sending the relevant issues list;
The receiving module 1001 is also used to receive the first global write transaction set and the second global write transaction set, and described first Transaction status of the first global write affairs in corresponding node equipment included by global write transaction set includes being carrying out state With prepare submission state, thing of the second global write affairs in corresponding node equipment included by the second global write transaction set Business state is to be carrying out state;
Output module 1004, for having been filed on shape when the first global write affairs in the first global write transaction set are in State exports the second mesh according to the first global write transaction set, the second global write transaction set and the global read transaction Mark data, second target data includes based on the global read transaction, the first global write transaction set and described the The data that two global write transaction sets obtain.
In a kind of possible embodiment, the output module is used for the transaction snapshot according to the global read transaction, defeated Corresponding first tuple of the global read transaction, first tuple are the visible version of target tuple out;If the target Tuple includes the second tuple, and submitting the affairs of second tuple is any one first global write affairs, output described second Tuple, second tuple are the invisible version of the target tuple;If the target tuple includes the second tuple, and is mentioned The affairs for handing over second tuple are any one second global write affairs, ignore second tuple.
It should be understood that reading data device provided by the above embodiment is in reading data, only with above-mentioned each function The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above Energy.In addition, reading data device provided by the above embodiment and method for reading data embodiment belong to same design, it is specific real Existing process is detailed in embodiment of the method, and which is not described herein again.
Figure 11 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention, which can be because matching It sets or performance is different and generate bigger difference, may include one or more processors (central Processing units, CPU) 1101 and one or more memory 1102, wherein it is deposited in the memory 1102 At least one instruction is contained, at least one instruction is loaded by the processor 1101 and executed to realize above-mentioned each method The method for reading data that embodiment provides.Certainly, the electronic equipment can also have wired or wireless network interface, keyboard and The components such as input/output interface, to carry out input and output, which can also include other for realizing functions of the equipments Component, this will not be repeated here.Involved gateway server and node device can be in above-mentioned data read process Using the hardware configuration of the electronic equipment.
The embodiment of the invention also provides a kind of computer readable storage medium, which is applied to Server is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the computer readable storage medium, The instruction, the program, the code set or the instruction set are loaded by processor and are executed the reading data to realize above-described embodiment Operation performed by gateway server or node device in method.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (15)

1. a kind of method for reading data, which is characterized in that the described method includes:
The first instruction message is sent to the corresponding multiple node devices of global read transaction, first instruction message is used to indicate institute State the submission operation that multiple node devices stop carrying out global write affairs;
The relevant issues list of the multiple node device is received, the relevant issues list of each node device includes node device The transaction status of upper ongoing related global write affairs and each related global write affairs, each correlation global write affairs Corresponding at least two node devices in the multiple node device;
According to the relevant issues list of the multiple node device, the first global write transaction set, the first global write thing are determined Transaction status of the first global write affairs in corresponding node equipment included by business group includes being carrying out state and preparation mentions Friendship state;
The first global write transaction set is sent to the multiple node device;
The first object data that the multiple node device returns are received, the first object data include based on the global reading The data that affairs and the first global write transaction set obtain.
2. the method according to claim 1, wherein described arrange according to the relevant issues of the multiple node device Table determines that the first global write transaction set includes:
From the relevant issues list of the multiple node device, when transaction status packet of any affairs in corresponding node equipment When including the state of being carrying out and preparing submission state, it is global that described first is added to using the affairs as the first global write affairs Write transaction set.
3. the method according to claim 1, wherein the method also includes:
When any read transaction is related to cross-node operation, the read transaction is determined as global read transaction, to global transaction mark Know spanning set pocket transmission and generates request;
It receives the global transaction mark and generates the global transaction mark that cluster is returned, global transaction mark is complete as this The Transaction Identifier of office's read transaction.
4. the method according to claim 1, wherein the method also includes:
When using principal and subordinate's logic copy technology in the database of active and standby structure, the global transaction of host transmitting is received in standby host Operational order when, according to the global transaction of the global transaction mark on the standby host execute affairs Transaction Identifier carry out Assignment;
When using principal and subordinate's physical copy technology in the database of active and standby structure, what is be read out based on the global read transaction In the process, the transition state data in the rollback segment information of the current state data and the standby host that store in the standby host are read.
5. the method according to claim 1, wherein the method also includes:
When not receiving the response of at least one node device of the multiple node device in target duration, described in rollback Global read transaction.
6. a kind of method for reading data, which is characterized in that be applied to node device, which comprises
According to the first instruction message received, stop the submission operation for carrying out global write affairs, first instruction message is used It is operated in the submission for indicating that the corresponding multiple node devices stoppings of global read transaction carry out global write affairs;
Relevant issues list is obtained, the relevant issues list includes ongoing related global write thing on the node device The transaction status of business and each related global write affairs, each correlation global write affairs correspond in the multiple node device At least two node devices;
Send the relevant issues list;
The first global write transaction set is received, the first global write affairs included by the first global write transaction set are in corresponding node Transaction status in equipment includes the state that is carrying out and preparation submission state;
State is had been filed on when the first global write affairs in the first global write transaction set are in, according to first global write Transaction set and the global read transaction, export first object data, and the first object data include reading thing based on the overall situation Data acquired in business and the first global write transaction set.
7. according to the method described in claim 6, it is characterized in that, the acquisition relevant issues list includes:
Traverse ongoing global write affairs on the node device;
When any one global write office, corresponding node device includes that at least two nodes in the multiple node device are set It is standby, the affairs of writing are added to the relevant issues list.
8. according to the method described in claim 6, it is characterized in that, described according to the first global write transaction set and described complete Office's read transaction, exports the first object data, and the target data includes being based on the global read transaction and described first entirely Office writes data acquired in transaction set and includes:
According to the transaction snapshot of the global read transaction, the first tuple in the target tuple of the global read transaction, institute are exported Stating the first tuple is for the visible tuple of the global read transaction;
If including the second tuple in the target tuple of the overall situation read transaction, and it is any for submitting the affairs of second tuple A first global write affairs, export second tuple, and second tuple is for the sightless member of the global read transaction Group.
9. a kind of method for reading data, which is characterized in that the described method includes:
The second instruction message is sent to the corresponding multiple node devices of global read transaction, second instruction message is used to indicate institute State the relevant issues list that multiple node devices return to the global read transaction;
The relevant issues list of the multiple node device is received, the relevant issues list of each node device includes node device The transaction status of upper ongoing related global write affairs and each related global write affairs, each correlation global write affairs Corresponding at least two node devices in the multiple node device;
According to the relevant issues list of the multiple node device, the first global write transaction set and the second global write affairs are determined Group, transaction status of the first global write affairs in corresponding node equipment included by the first global write transaction set include just In the state of execution and prepare submission state, the second global write affairs included by the second global write transaction set are in corresponding node Transaction status in equipment is to be carrying out state;
When the first global write affairs in the first global write transaction set are in the state of having been filed in corresponding node equipment, The first global write transaction set and the second global write transaction set are sent to the multiple node device;
The second target data that the multiple node device returns is received, second target data includes based on the global reading The data that affairs, the first global write transaction set and the second global write transaction set obtain.
10. according to the method described in claim 9, it is characterized in that, the relevant issues according to the multiple node device List, determines the first global write transaction set and the second global write transaction set includes:
From the relevant issues list of the multiple node device, if affairs of any global write affairs in corresponding node equipment State includes the state that is carrying out and prepares submission state, is added to institute for the global write affairs as the first global write affairs State the first global write transaction set;
From the relevant issues list of the multiple node device, if affairs of any global write affairs in corresponding node equipment State is to be carrying out state, is added to the second global write thing for the global write affairs as the second global write affairs Business group.
11. a kind of method for reading data, which is characterized in that be applied to node device, which comprises
The second instruction message is received, multiple node devices that second instruction message is used to indicate global read transaction return related Transaction list;
Relevant issues list is obtained, the relevant issues list of each node device includes ongoing phase on the node device The transaction status of global write affairs and each related global write affairs is closed, each correlation global write affairs correspond to the multiple At least two node device in node device;
Send the relevant issues list;
The first global write transaction set and the second global write transaction set are received, first is complete included by the first global write transaction set Office writes transaction status of the affairs in corresponding node equipment and includes the state that is carrying out and prepare submission state, and described second is global Writing transaction status of the second global write affairs in corresponding node equipment included by transaction set is to be carrying out state;
State is had been filed on when the first global write affairs in the first global write transaction set are in, according to first global write Transaction set, the second global write transaction set and the global read transaction, export the second target data, second number of targets According to including the number obtained based on the global read transaction, the first global write transaction set and the second global write transaction set According to.
12. according to the method for claim 11, which is characterized in that it is described according to the first global write transaction set, it is described Second global write transaction set and the global read transaction, export the second target data, and second target data includes being based on The overall situation read transaction, the first global write transaction set and the data of the second global write transaction set acquisition include:
According to the transaction snapshot of the global read transaction, the first tuple in the target tuple of the global read transaction, institute are exported Stating the first tuple is for the visible tuple of the global read transaction;
If including the second tuple in the target tuple of the overall situation read transaction, and it is any for submitting the affairs of second tuple A first global write affairs, export second tuple, and second tuple is for the sightless member of the global read transaction Group;
If including the second tuple in the target tuple of the overall situation read transaction, and it is any for submitting the affairs of second tuple A second global write affairs ignore second tuple.
13. a kind of reading data device, which is characterized in that described device includes:
Sending module, for sending the first instruction message, first instruction to the corresponding multiple node devices of global read transaction Message is used to indicate the submission operation that the multiple node device stops carrying out global write affairs;
Receiving module, for receiving the relevant issues list of the multiple node device, the relevant issues column of each node device Table includes the transaction status of ongoing related global write affairs and each related global write affairs on node device, each Related global write affairs correspond at least two node devices in the multiple node device;
Determining module determines the first global write transaction set for the relevant issues list according to the multiple node device, described Transaction status of the first global write affairs in corresponding node equipment included by first global write transaction set includes being carrying out State and preparation submission state;
The sending module is also used to send the first global write transaction set to the multiple node device;
The receiving module is also used to receive the first object data that the multiple node device returns, the first object number According to including the data obtained based on the global read transaction and the first global write transaction set.
14. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, is deposited in the memory At least one instruction is contained, at least one instruction is loaded by the processor and executed to realize as in claim 1 to 12 Operation performed by method for reading data provided by any one.
15. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, institute in the storage medium At least one instruction is stated to be loaded as the processor and executed to realize that the data as provided by any one of claims 1 to 12 are read Take operation performed by method.
CN201910021181.9A 2019-01-09 2019-01-09 Data reading method and device, electronic equipment and storage medium Active CN109783578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910021181.9A CN109783578B (en) 2019-01-09 2019-01-09 Data reading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910021181.9A CN109783578B (en) 2019-01-09 2019-01-09 Data reading method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109783578A true CN109783578A (en) 2019-05-21
CN109783578B CN109783578B (en) 2022-10-21

Family

ID=66499299

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910021181.9A Active CN109783578B (en) 2019-01-09 2019-01-09 Data reading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109783578B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190935A (en) * 2019-08-27 2020-05-22 中国人民大学 Data reading method and device, computer equipment and storage medium
CN111338766A (en) * 2020-03-12 2020-06-26 腾讯科技(深圳)有限公司 Transaction processing method and device, computer equipment and storage medium
WO2021217863A1 (en) * 2020-04-29 2021-11-04 平安科技(深圳)有限公司 Order identifier generation method and apparatus, server, and storage medium
CN114661816A (en) * 2020-12-24 2022-06-24 金篆信科有限责任公司 Data synchronization method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831156A (en) * 2012-06-29 2012-12-19 浙江大学 Distributed transaction processing method on cloud computing platform
CN103164219A (en) * 2013-01-08 2013-06-19 华中科技大学 Distributed transaction processing system using multi-type replica in decentralized schema
WO2016078423A1 (en) * 2014-11-17 2016-05-26 中兴通讯股份有限公司 Transaction processing method and apparatus for distributed database system
CN108027829A (en) * 2015-07-10 2018-05-11 起元技术有限责任公司 The system and framework of Access and control strategy of database are provided in the network with distributed data base system
US20180150504A1 (en) * 2016-11-30 2018-05-31 Sap Se Write Access Control in a Database

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831156A (en) * 2012-06-29 2012-12-19 浙江大学 Distributed transaction processing method on cloud computing platform
CN103164219A (en) * 2013-01-08 2013-06-19 华中科技大学 Distributed transaction processing system using multi-type replica in decentralized schema
WO2016078423A1 (en) * 2014-11-17 2016-05-26 中兴通讯股份有限公司 Transaction processing method and apparatus for distributed database system
CN108027829A (en) * 2015-07-10 2018-05-11 起元技术有限责任公司 The system and framework of Access and control strategy of database are provided in the network with distributed data base system
US20180150504A1 (en) * 2016-11-30 2018-05-31 Sap Se Write Access Control in a Database

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
卢正鼎等: "多数据库系统中的一致性维护", 《计算机研究与发展》 *
鄢勇等: "一基于数据驱动的分布式事务计算模型", 《计算机学报》 *
黄超等: "分布式数据库系统中数据一致性维护方法讨论", 《沿海企业与科技》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111190935A (en) * 2019-08-27 2020-05-22 中国人民大学 Data reading method and device, computer equipment and storage medium
CN111338766A (en) * 2020-03-12 2020-06-26 腾讯科技(深圳)有限公司 Transaction processing method and device, computer equipment and storage medium
CN111338766B (en) * 2020-03-12 2022-10-25 腾讯科技(深圳)有限公司 Transaction processing method and device, computer equipment and storage medium
WO2021217863A1 (en) * 2020-04-29 2021-11-04 平安科技(深圳)有限公司 Order identifier generation method and apparatus, server, and storage medium
CN114661816A (en) * 2020-12-24 2022-06-24 金篆信科有限责任公司 Data synchronization method and device, electronic equipment and storage medium
CN114661816B (en) * 2020-12-24 2023-03-24 金篆信科有限责任公司 Data synchronization method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109783578B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
CN109739935A (en) Method for reading data, device, electronic equipment and storage medium
WO2020224374A1 (en) Data replication method and apparatus, and computer device and storage medium
CN106991113B (en) Table replication in a database environment
US10678808B2 (en) Eager replication of uncommitted transactions
CN109710388A (en) Method for reading data, device, electronic equipment and storage medium
US7801851B2 (en) Method for ensuring referential integrity in multi-threaded replication engines
Cowling et al. Granola:{Low-Overhead} distributed transaction coordination
JP4833590B2 (en) Concurrent transactions (CONCURRENT TRANSACTIONS) and page synchronization (PAGESYNCHRONIZATION)
JP5660693B2 (en) Hybrid OLTP and OLAP high performance database system
CN109783578A (en) Method for reading data, device, electronic equipment and storage medium
US7103586B2 (en) Collision avoidance in database replication systems
US7779295B1 (en) Method and apparatus for creating and using persistent images of distributed shared memory segments and in-memory checkpoints
US7917596B2 (en) Super master
CN107148617B (en) Automatic configuration of log-coordinated storage groups
CN110196856B (en) Distributed data reading method and device
US10601890B2 (en) Recoverable stream processing
US11263236B2 (en) Real-time cross-system database replication for hybrid-cloud elastic scaling and high-performance data virtualization
US20050160315A1 (en) Geographically distributed clusters
Yan et al. Carousel: Low-latency transaction processing for globally-distributed data
CN104793988A (en) Cross-database distributed transaction implementation method and device
EP4276651A1 (en) Log execution method and apparatus, and computer device and storage medium
WO2022048416A1 (en) Operation request processing method and apparatus, and device, and readable storage medium, and system
US9201685B2 (en) Transactional cache versioning and storage in a distributed data grid
US20220300459A1 (en) Real-time data replication in a multiple availability zone cloud platform
US20230289368A1 (en) Asynchronous data replication in a multiple availability zone cloud platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230920

Address after: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Patentee after: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Patentee after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Address before: 518057 Tencent Building, No. 1 High-tech Zone, Nanshan District, Shenzhen City, Guangdong Province, 35 floors

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right