Data updating method and device for a distributed database system
摘要:
A method and an apparatus for updating data for a distributed database system are disclosed. The method includes: obtaining a data table stored in each of servers in the distributed database system, and for each obtained data table, reading each row of data in this obtained data table (S101); determining, for each row of data read, whether a key for this row of data exists in the hash table stored in the server (S102); if the key for this row of data does not exist in the hash table, writing the row of data into the hash table, and writing the key and version information for the row of data into the hash table (S105); if the key for this row of data exists in the hash table, reading a first version number of the row of data in the data table, and determining whether the first version number is greater than a second version number for the row of data stored in the hash table (S103); if the first version number is greater than the second version number, updating the row of data into the hash table and updating version information for the row of data (S104); sending the hash table to a master server so as to cause each of servers in the distributed database system to perform data recovery based on the hash table received by the master server (S106). The method can recover the latest data in a distributed database system.
信息查询
0/0