Patent attributes
Embodiments provide a data block storage method applied to a database employing an LSM tree. According to the method, data in the 0th layer of the LSM tree is organized in MacroBlocks. When the data in the LSM tree is transferred from an upper layer to a lower layer, the data is transferred to the lower layer in the form of MacroBlocks, so that all layers of the LSM tree are organized in the form of MacroBlocks. When inter-layer data merger is performed, the merger may be performed based on the MacroBlocks, which can avoid rewriting of all data on an entire layer and can effectively reduce disk IO and temporary space consumption. Moreover, as each MacroBlock comprises a plurality of variable-length MicroBlocks, the data may be stored in a storage space in a more compact manner.