Method and apparatus for replicating data
Provided herein are a method and an apparatus for replicating data. A master node or a data node stores data and indices in a table region including a plurality of data regions and a plurality of index regions, merges the plurality of index regions with one another to be one index region, and then replicates a table region including the plurality of data regions and the one index region to other nodes.
1. A method for replicating data of a time series database including a master node and one or more data nodes, performed by a node apparatus constituting a database system, comprising:
storing data and indices in a table region including a plurality of data regions and a plurality of index regions;
merging the plurality of index regions with one another to be one index region; and
replicating a table region including the plurality of data regions and the one index region to other nodes,
wherein the merging is performed by modifying a relation identifier so as to indicate the plurality of index regions, and
the replicating is performed by using the relation identifier indicating the plurality of index regions.
2. The method for replicating data of claim 1 , wherein the storing includes:
allocating the table region; and
storing the data and the indices in the allocated table region.
3. The method for replicating data of claim 1 , wherein the indices include information in a bitmap form on positions in which the data are stored and on data values.
4. The method for replicating data of claim 3 , wherein the merging includes merging bitmaps stored in each of the plurality of index regions with one another to be one bitmap and storing the one bitmap in one index region.
5. The method for replicating data of claim 1 , wherein the respective indices stored in the plurality of index regions are log structured merge tree (LSMT) indices.
6. A node apparatus of a database, comprising:
a data receiving unit receiving data;
a data storing unit storing data and indices in a table region including a plurality of data regions and a plurality of index regions; and
a replicating unit merging the plurality of index regions with one another to be one index region and replicating a table region including the plurality of data regions and the one index region to other nodes,
wherein the merging is performed by modifying a relation identifier so as to indicate the plurality of index regions, and
the replicating is performed by using the relation identifier indicating the plurality of index regions.
7. A computer-readable non-transitory recording medium in which programs for performing a method for replicating data by a node apparatus constituting a database system in a time series database including a master node and one or more data nodes are recorded, the method for replicating data including:
storing data and indices in a table region including a plurality of data regions and a plurality of index regions;
merging the plurality of index regions with each other to be one index region; and
replicating a table region including the plurality of data regions and the one index region to other nodes,
wherein the merging is performed by modifying a relation identifier so as to indicate the plurality of index regions, and
the replicating is performed by using the relation identifier indicating the plurality of index regions.
8. The computer-readable non-transitory recording medium of claim 7 , wherein the storing includes:
allocating the table region; and
storing the data and the indices in the allocated table region.
9. The computer-readable non-transitory recording medium of claim 7 , wherein the indices include information in a bitmap form on positions in which the data are stored and on data values.
10. The computer-readable non-transitory recording medium of claim 9 , wherein the merging includes merging bitmaps stored in each of the plurality of index regions with one another to be one bitmap and storing the one bitmap in one index region.
11. The computer-readable non-transitory recording medium of claim 7 , wherein the respective indices stored in the plurality of index regions are LSMT indices.