Database management system and method using append-only storage device

By using log directories and storage nodes in the database management system to manage append-only storage devices, the problems of shortened life and low performance when the traditional database management system is combined with append-only storage devices are solved, and efficient storage management and performance improvement are achieved.

CN111936977BActive Publication Date: 2024-09-10HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201880084681.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-12-29
Filing Date
2018-12-20
Publication Date
2024-09-10
Estimated Expiration
2038-12-20

AI Technical Summary

Technical Problem

The in-place update process used by traditional database management systems is not suitable for use with modern append-only storage devices, resulting in shortened lifespan and poor performance of append-only storage devices.

Method used

By introducing log directories and storage nodes in the database management system, using log writers and page readers to convert page write requests and read requests into append-only operations to store logs, and merging and cleaning log fragments through log cleaners , to achieve efficient management of append-only storage devices.

Benefits of technology

It extends the life of append-only storage devices, improves storage performance, reduces operating costs, and enables flexible expansion and efficient data management of database systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111936977B_ABST
    Figure CN111936977B_ABST
Patent Text Reader

Abstract

The present invention discloses a device. The device can be implemented in a database node or a storage node, and includes one or more processors and a memory, wherein the memory stores instructions for causing the processor to perform multiple operations. The device determines an identifier corresponding to a requested page according to a page write request; sends a component block corresponding to the page to a storage node for appending to an append-only storage log of the storage node; receives a physical location of a stored component block; and associates the physical storage location of the stored component block with a logical identifier corresponding to the page.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Related Applications Cross-Application

[0002] This patent application claims priority to U.S. patent application No. 15 / 858,960, filed on December 29, 2017, entitled “SYSTEMS AND METHODS FOR DATABASE MANAGEMENT USING APPEND-ONLY STORAGE DEVICES,” which is incorporated herein by reference as if reproduced in its entirety. Technical Field

[0003] The present application relates to database management, and more particularly to database management in an append-only storage system. Background Art

[0004] Computing devices are becoming more and more ubiquitous. As a result, users are consuming and storing more and more data. Data is stored on physical computer-readable storage media as an organized collection of data, often called a database. Databases are often used to store data that is accessible to users. One common type of database is a relational database, in which many tables are linked by relationships between stored data entries. In some databases, unique keys are used to identify rows in these tables.

[0005] Traditional databases typically use an "in-place update" process to update records in the database. When a record in a database is modified, the in-place update process typically overwrites the physical block of the storage device that holds the previous record with an updated version of the record. The in-place update process works properly with traditional storage devices such as hard disk drives (HDDs). Append-only storage devices such as solid-state drives (SSDs) offer many advantages over traditional HDDs, including improved read and write speed performance and reduced power consumption. Therefore, modern data centers prefer to adopt append-only storage devices. However, append-only storage devices are not suitable for use with traditional database systems. Summary of the invention

[0006] According to one aspect of the present invention, a device is provided, comprising: one or more processors; a memory storing processor-executable instructions, wherein when the one or more processors execute the instructions, the one or more processors perform the following operations: receiving a page write request associated with one or more component blocks of a page; a log writer determining a logical identifier corresponding to the page in a log directory; the log writer sending each corresponding component block of the one or more component blocks to a storage node for appending to an append-only storage log of the storage node; receiving a physical storage location of each component block of the one or more component blocks from the storage node; and associating the physical storage location of each component block of the one or more component blocks with the logical identifier corresponding to the page in the log directory.

[0007] In any of the above embodiments, the processor executable instructions also cause the one or more processors to perform the following operations: receiving a page read request associated with a page; the log directory determines the physical storage location of one or more component blocks of the requested page in the storage node; the page reader retrieves the one or more component blocks of the requested page from the storage node based on the physical storage location of the one or more component blocks; and returns the requested page.

[0008] In any of the above embodiments, the one or more component blocks of the requested page include at least two component blocks, wherein returning the requested page includes reconstructing the requested page from the at least two retrieved component blocks by the page reader.

[0009] In any of the above embodiments, the processor executable instructions further cause the one or more processors to perform the following operations: the log writer sends the reconstructed page to the storage node for appending to the append-only storage log of the storage node.

[0010] In any of the above embodiments, the at least two component blocks are retrieved from the storage node in parallel.

[0011] In any of the above embodiments, the component blocks include one or more of complete pages and page increments.

[0012] In any of the above embodiments, the storage node is far away from the database node.

[0013] In any of the above embodiments, the storage node is a local node of the database node.

[0014] In any of the above embodiments, the device is integrated into one of the database node and the storage node.

[0015] In any of the above embodiments, the processor executable instructions also cause the one or more processors to perform the following operations: the log cleaner collects at least one real-time data block from the fragment of the append-only storage log; and sends the at least one real-time data block to the storage node for appending to the end of the append-only storage log.

[0016] In any of the above embodiments, the at least one real-time data block includes at least two real-time data blocks, wherein sending the at least one real-time data block to the storage node for appending includes reconstructing a real-time page through the at least two real-time data blocks, and sending the reconstructed real-time page to the storage node.

[0017] In any of the above embodiments, the processor executable instructions further cause the one or more processors to perform the following operations: notify the storage node to clean up the segment of the append-only storage log.

[0018] According to another aspect of the present invention, a method is provided, comprising: a database node receiving a page write request associated with one or more component blocks of a page; determining a logical identifier corresponding to the page in a log directory; sending each corresponding component block of the one or more component blocks to a storage node for appending to an append-only storage log of the storage node; receiving data indicating a physical storage location of each of the one or more component blocks from the storage node; and associating, in the log directory, the physical storage location of each of the one or more component blocks with the logical identifier corresponding to the page.

[0019] In any of the above embodiments, the method also includes: if the database node receives a page read request related to a page: the log directory determines the physical storage location of one or more component blocks of the requested page in the storage node; according to the physical storage location of the one or more component blocks, retrieves the one or more component blocks of the requested page from the storage node; and returns the requested page.

[0020] In any of the above embodiments, the one or more component blocks of the requested page include at least two component blocks, wherein returning the requested page includes reconstructing the requested page from the at least two retrieved component blocks by the page reader.

[0021] In any of the above embodiments, the method further includes: sending the reconstructed page to the storage node for appending to the append-only storage log of the storage node.

[0022] In any of the above embodiments, the at least two component blocks are retrieved from the storage node in parallel.

[0023] In any of the above embodiments, the component blocks include one or more of complete pages and page increments.

[0024] In any of the above embodiments, the storage node is far away from the database node.

[0025] In any of the above embodiments, the storage node is a local node of the database node.

[0026] In any of the above embodiments, the method further includes: collecting at least one real-time data block from the fragment of the append-only storage log in the storage node; sending the at least one real-time data block to the storage node for appending to the end of the append-only storage log.

[0027] In any of the above embodiments, the at least one real-time data block includes at least two real-time data blocks, wherein sending the at least one real-time data block to the storage node for appending includes reconstructing a real-time page through the at least two real-time data blocks, and sending the reconstructed real-time page to the storage node.

[0028] In any of the above embodiments, the method further includes: notifying the storage node to clean up the fragment of the append-only storage log on the storage node. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In the drawings illustrating exemplary embodiments:

[0030] Figure 1 is a block diagram illustrating an exemplary database system;

[0031] Figure 2 is a block diagram illustrating components of an exemplary client device;

[0032] Figure 3 is a block diagram illustrating components of an exemplary database node;

[0033] Figure 4 is a descriptive diagram of the layers executed on database nodes and append-only storage nodes;

[0034] Figure 5 Yes Description Figure 1 An expanded view of the logical representation of the components of a database cluster in

[0035] Figure 6 is a block diagram illustrating the operation of a log writer component;

[0036] Figure 7 is a block diagram illustrating the operation of a log cleaner component;

[0037] Figure 8 is a block diagram illustrating an exemplary database cluster providing services with a centralized storage abstraction layer;

[0038] Fig. 9 is a block diagram illustrating an exemplary database cluster providing services with a distributed storage abstraction layer.

[0039] For purposes of illustration, these drawings depict aspects of the exemplary embodiments. DETAILED DESCRIPTION

[0040] As mentioned above, the "update in place" process works particularly well on HDDs, because HDDs can locate and overwrite new data relatively easily. However, append-only storage devices, such as SSDs, operate differently than HDDs. Append-only storage devices are generally unable to overwrite data in the same physical block unless they first perform several operations to erase the physical block before writing the new data.

[0041] When data is modified in an append-only storage device, the append-only storage device typically does not overwrite the data at the same physical location as the previous data, but instead writes the modified data to an already empty block or page. The previous version of the data is then marked for deletion and eventually deleted through a process called "garbage collection." Garbage collection may occur at varying intervals during normal operation of an append-only storage device.

[0042] Space occupied by obsolete data blocks found during garbage collection is erased (cleaned) before the space can be reused. The storage media used in SSDs has a finite lifespan in terms of erase cycles, so using an in-place update process may shorten the lifespan of an append-only storage device such as an SSD. Additionally, the in-place update process on an append-only storage device is inefficient because frequent random writes are required (versus sequential writes, which are more performant in append-only storage devices such as SSDs).

[0043] In summary, the traditional "update in place" process used by traditional database management systems is not suitable for use with modern append-only storage devices (such as SSDs). The present invention provides an apparatus and method for performing instruction interaction between a database management layer and an append-only physical storage device in a storage layer.

[0044] Figure 11 is a block diagram illustrating components of an exemplary database system 100. In the exemplary database system 100, one or more client devices 102 may be connected to a database cluster 106 via a communication network 104 and a communication link 103. The database cluster 106 implements a database service and includes database nodes 108 that may be used to store and retrieve data in append-only storage nodes 110 via data links 109. Figure 1 The append-only storage nodes 110 are illustrated as being remote from the database nodes 108, but it is contemplated that in some embodiments, the database nodes 108 include local append-only storage devices. The communication links 103 may be wired or wireless, and any acceptable protocol may be used to send data to the database nodes 108 via the communication network 104. As shown, the database node includes three append-only storage nodes 110. It should be understood that in contemplated embodiments, there are less than three or more than three append-only storage nodes 110. For example, the append-only storage nodes 110 may include SSD storage devices.

[0045] Figure 2 is a block diagram illustrating components of an exemplary client 102. Client 102 may be any suitable computing device such as a desktop computer, laptop computer, tablet computer, smartphone, etc. Client 102 includes one or more processors 201 for controlling the overall operation of client 102. Processor 201 interacts with memory 204 via memory bus 203, and interacts with memory 206, I / O device 208, and network interface 210 via bus 209. Bus 209 may be one or more of any type of several buses, including a peripheral bus, a video bus, etc.

[0046] Each processor 201 may be any suitable type of processor, such as a central processing unit (CPU) implementing an ARM or x86 instruction set, and may also include a special processor such as a graphics processing unit (GPU) or other such processors. The memory 204 includes any suitable type of system memory that can be read by the processor 201, such as a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous DRAM (SDRAM), a read-only memory (ROM), or a combination thereof. In one embodiment, the memory 201 may include more than one type of memory, such as a ROM used when booting, and a DRAM for executing programs and storing data when executing programs. The memory 206 may include any type of non-transient storage device for storing data, programs, and other information, and making these data, programs, and other information accessible through the bus 209. For example, the memory 206 may include one or more of a solid-state drive, a hard disk drive, a magnetic disk drive, an optical disk drive, and a secure digital (SD) memory card.

[0047] I / O devices 208 include user interface devices, such as display devices, including touch-sensitive display devices capable of displaying rendered images as output and receiving input in the form of touch. In some embodiments, I / O devices 208 additionally or alternatively include one or more of speakers, microphones, cameras, sensors (e.g., accelerometers and global positioning system (GPS) receivers), keyboards, etc. In some embodiments, I / O devices 208 include ports for connecting client 102 to other client devices. In an exemplary embodiment, I / O devices 208 include a universal serial bus (USB) controller for connecting to peripheral devices or a host computing device.

[0048] The network interface 210 can connect the client 102 to the communication network 104. In some embodiments, the network interface 210 includes one or more wired interfaces (e.g., wired Ethernet) and wireless radios, such as WiFi, Bluetooth, or cellular (e.g., GPRS, GSM, EDGE, CDMA, LTE). The network interface 210 enables the client 102 to communicate with the database cluster 106 through the communication network 104 and the communication link 103. The network interface 210 can also be used to establish a virtual network interface, such as a virtual private network (VPN).

[0049] Figure 3 is a block diagram illustrating the components of an exemplary database node 108. As described herein, the database node 108 includes a combination of hardware devices and software executed in the memory of the hardware devices. The hardware devices of the database node 108 include one or more processors 181, a memory 184, and a network interface 190. The one or more processors 181 interact with the memory 184 via a memory bus 183 and interact with the network interface 190 via a bus 189. As shown, in some embodiments, the hardware devices of the database node 108 may include an append-only memory 185. The local append-only memory 185 may include any number of suitable append-only storage devices, such as a flash-based SSD. It will be appreciated by those skilled in the art that the database node 108 may additionally include conventional storage elements, such as a hard disk drive, to replace the append-only memory 185 or to be used together with the append-only memory 185.

[0050] like Figure 3 As shown, the append-only storage node 110 is located outside the database node 108, and the database node 108 can communicate with the append-only storage node 110 through the network interface 190. The append-only storage node 110 includes a combination of hardware devices and software executed in the memory of the hardware device. The hardware device of the append-only storage node 110 may include one or more processors, memories, network interfaces, and one or more append-only storage devices 350 (hereinafter referred to as append-only storage devices 350, collectively referred to as append-only storage devices 185). Each append-only storage device 350 can be any suitable append-only storage device, such as an SSD. In some embodiments, the append-only storage node 110 may include traditional storage elements such as hard disk drives in addition to the append-only storage device 350. It should be understood that the presence of traditional storage elements may not be obvious to the database node 108 (or any node other than the append-only storage node 110), and the presence of traditional storage elements does not necessarily change the way in which the database node 108 interacts with the append-only storage node 110 to store data in the append-only storage device 350.

[0051] Figure 4 Is a description Figure 1 106 is a platform for providing database services, including a database management system (DBMS) layer 305, a storage abstraction layer 310, and a storage layer 315. The DMBS layer 305 can be provided by one or more processors 181 of the database node 108 executing software such as processor executable instructions. After executing the software, the database node 108 is used to act as the DMBS layer 305 (or a component of the layer). The storage layer 315 is a representation of a storage function. In one embodiment, for example, when the software such as processor executable instructions is executed by one or more processors of the append-only storage node 110, the configuration Figure 1 The append-only storage node 110 of the computing platform acts as the storage layer 315 (or a component of the layer). In some embodiments, when the database node 108 includes a local append-only storage 185, the storage layer 315 also controls the operation of the local append-only storage device 185. The storage abstraction layer 310 is an interface between the DMBS layer 305 and the storage layer 315. In some embodiments, for example, the storage abstraction layer 310 can be implemented as software such as processor executable instructions, which configures the resources of the platform to receive requests including read page requests, write page requests, write page increment requests, etc. from the DBMS layer 305 when the processor in the computing platform executes the instructions, and converts or transforms these requests into instructions that enable the storage layer 315 to store data on the physical append-only storage device 350 of the append-only storage node 110, retrieve data from the physical storage device of the append-only storage node 110, or modify data on the physical storage device of the append-only storage node 110. The storage abstraction layer 310 can be used to respond to requests received from the DBMS layer 305 while ensuring the persistence of data stored on the append-only physical storage devices of the storage layer 315, as described in further detail below. In some embodiments, the processor executable instructions of the storage abstraction layer 310 are loaded into the memory and executed by one or more processors of the device. In some embodiments, the storage abstraction layer 310 can be integrated into the database node 108, as described in further detail below. In some embodiments, the storage abstraction layer 310 can be integrated into the append-only storage node 110, as described in further detail below. Although this may create redundancy, the storage abstraction layer 310 can be integrated into each layer in the DBMS layer 305 and the storage layer 315. In this embodiment, when the storage abstraction layer is integrated into a node or resource that provides different layer functions, the layer-associated processing resources integrated with the storage abstraction layer can be used to execute software, and the software configuration resources act as a storage abstraction layer.

[0052] Those skilled in the art will appreciate that in a data center such as a database cluster 106, virtualization can be used to provide a virtual hardware platform so that software can be executed on the platform. From the perspective of the executed software, virtualized hardware is no different from physical hardware. Virtualization can be performed in a variety of different ways, and a single virtualized hardware platform can be created on multiple different physical database nodes and only the resources of the storage node are added. Similarly, multiple different virtual hardware platforms can be created on a single physical database node 108, only the storage node 110 is added, or both.

[0053] like Figure 4 As shown, the DBMS layer 305 is capable of issuing "read page" requests and "write page increment" requests. In some embodiments, the DBMS layer 305 is implemented using SQL server, DB2, MySQL, PostgreSQL, Oracle, SQLite, etc. The DBMS layer 305 includes a buffer pool 306 (also called a buffer cache). The buffer pool 306 contains database pages. The DBMS layer 305 is used to request a page from the storage layer 315 (a "read page" request) and write a new page in the storage layer 315 (a "write page" request) or modify an existing page in the storage layer 315 (a "write page increment" request). As described herein, a page increment is a modification to a page, encoded as a change relative to a previous version of the page in the append-only log 316. Page increments can be appended to the append-only log 316.

[0054] As shown, buffer pool 306 contains a first version of a first page of memory (depicted as page 1 version 1 307 ) and an eighth version of a second page (depicted as page 2 version 8 308 ).

[0055] The storage layer 315 includes an append-only log 316, which contains a complete image of the component blocks of the page (typically the latest version of the page), and may also contain subsequent increments of the page. As shown, the append-only log 316 contains a complete image of the first page (depicted as page 1, version 1 307), and a complete image of the sixth version of the second page (depicted as page 2, version 6 318a), including increments of subsequent changes to the sixth version of the second page (depicted as page 2, version 7 318b), and increments containing subsequent changes to the seventh version of the second page (depicted as page 2, version 8 318c). In some embodiments, blocks 318a, 318b, and 318c are stored in sequential blocks in an append-only storage device 350 on an append-only storage node 110. As shown in FIG. Figure 4 As shown, blocks 318b and 318c are stored in sequential blocks.

[0056] like Figure 4As shown, the storage abstraction layer 310 includes a log directory 311, a log writer 312, a page reader 313, and a log cleaner 314. It should be understood that the log cleaner 314 is an optional component, and in some embodiments, the storage abstraction layer 310 does not include the log cleaner 314.

[0057] The storage abstraction layer 310 associates logical identifiers with the physical locations of component chunks using a log directory 311. The log directory 311 contains data that tracks the locations of full pages and page increments (collectively referred to herein as "component chunks" of a page) on physical append-only storage devices in the storage nodes 110. In some embodiments, the log directory contains data indicating which append-only storage node 110 stores a page, and indicating which specific append-only storage device in the append-only storage node 110 stores the page. For example, Figure 4 As shown, log directory 311 stores the physical location of each component block of page 1 and page 2 in append-only log 316 (page 1 version 1 307, page 2 version 6 318a, page 2 version 7 318b, page 2 version 8 318c).

[0058] The storage abstraction layer 310 uses a log writer 312 to append component blocks to an append-only log 316. The log writer 312 can be used to receive a "write page" request and instruct the storage layer 315 to append a new component block (i.e., a page or page increment) or a group of component blocks to the append-only log 316 of the storage layer 315. When the storage abstraction layer 310 receives a write request from the DBMS layer 305, the storage abstraction layer 310 associates a logical identifier with the component block and records the logical identifier in the log directory 311. The component block is sent to the storage layer 315, and the storage layer 315 appends the component block to the append-only log 316. Once appended, the storage layer 315 returns or sends an identifier of the physical location of the component block that has been appended. The storage abstraction layer 310 then associates the received identifier of the physical location of the component block with the logical identifier in the log directory 311. In some embodiments, the component blocks appended to the append-only log 316 are appended to sequential storage blocks in the physical storage device.

[0059] The page reader 313 may be used to reconstruct the requested version of the page from the complete page and any subsequent page increments stored in the append-only log 316. In some embodiments, the storage abstraction layer 310 includes a log cleaner 314. The log cleaner 314 may be used to construct a merged version of the page from the component blocks, then discard obsolete data and instruct the storage layer 315 to merge the append-only log 316. The log cleaner 314 may also copy the component blocks to the front of the log without merging the component blocks.

[0060] The DBMS layer 305 is unaware of the implementation details of the storage layer 315 and the physical storage devices 350 of the append-only storage nodes 110. The storage abstraction layer 310 acts as an interface between the DMBS layer 305 and the storage layer 315 to convert or translate page read requests and page write requests into instructions that cause the storage layer 315 to perform operations to append one or more component blocks to the append-only storage device 350 and read one or more component blocks from the append-only physical storage device 350.

[0061] Figure 5 is a block diagram describing the operation of the page reader component 313 in the storage abstraction layer 310. When the storage abstraction layer 310 receives a page read request from the DBMS layer 305, a read operation is initiated. In this example, the page read request is for the latest version of page 2. When the page reader 313 of the storage abstraction layer 310 receives the page read request, the page reader 313 determines the logical identifier of the requested page and looks up the physical locations of the component blocks of the requested page in the log directory 311. In some embodiments, the physical location of each block includes an identifier indicating the append-only storage node 110 storing the requested block and an identifier indicating the append-only storage device 350, 352 storing the block. In this example, the requested page component blocks include the full version 6 318a and the increments 318b and 318c. Upon receiving the location of each page and delta from the log directory 311, the storage abstraction layer 310 interacts with the storage layer 315, which retrieves each page and delta from the append-only log 316 in the storage layer 315 and sends each retrieved page and delta to the storage abstraction layer 310. In some embodiments, the retrieved pages and deltas are retrieved in parallel.

[0062] Upon receipt, the page reader 313 reconstructs page 2 starting from the latest complete version (318a) of the requested page, and then processes the subsequent increments 318b and 318c to create a reconstructed complete version 318 of page 2, version 8. The reconstructed page 318 is then sent to the buffer pool 306 of the DBMS layer 305, for example, where it can be used to be read or modified by the client device 102.

[0063] In some embodiments, storage abstraction layer 310 may interact with storage layer 315 to append reconstructed full version 318 of page 2, version 8 to append-only log 316 using log writer 312. If full page 2, version 8 318 is appended to append-only log 316, page reader 313 will also provide an update to log directory 311 that includes the physical storage location of the newly appended page 318. It will be appreciated by those skilled in the art that adding full version 318 of page 2, version 8 will cause previously recorded component blocks 318a, 318b, and 318c to be redundant.

[0064] Therefore, appending the reconstructed complete page 2 version 8 318 to the append-only log 316 allows the log cleaning mechanism to delete the redundant component blocks 318a, 318b, and 318c from the append-only log 316, thereby cleaning up space in the log 316. In addition, it should be noted that writing the complete version 318 of page 2 version 8 avoids using the previous component blocks 318a, 318b, and 318c to reconstruct page 2 version 8. As a result, subsequent read operations on the page may be more efficient.

[0065] As described above, component chunks (full pages and page deltas) may be written or appended to an append-only log 316 in the storage tier 315 . Figure 6 318d). As described above, for simplicity, the write request includes only one page increment. It should be noted that in some embodiments, it is expected that the page write request includes multiple page increments to enter the append-only log 316 of the storage layer 315.

[0066] For each component block in the log buffer, the log writer 312 parses the content of the component block to determine the logical identifier in the log directory 311 to which each component block applies. If there is no corresponding log record for the component block in the log directory 311, a new record is created in the log directory 311 using the logical identifier of the component block. The log writer 312 then sends an instruction to the storage layer 315 to append the increment 318d of page 2, version 9 to the append-only log 316. It should be noted that in embodiments where multiple increments are appended, the multiple increments can be written to the append-only log 316 in sequence.

[0067] After writing the delta 318d to the append-only log 316, the log writer 312 receives an identifier indicating the physical location of the page delta 318d from the storage layer 315. The identifier indicating the physical location of the delta 318d is then associated with the logical identifier of the component block in the log directory 311.

[0068] After successfully writing the delta 318d to the append-only log 316 and storing the location in the log directory 311, the storage abstraction layer 310 sends or returns a response to the DBMS layer 305 indicating that the write operation was successful.

[0069] In some embodiments, the storage abstraction layer 310 includes a log cleaner 314. The log cleaner 314 can be used to interact with the storage layer 315 to clean or merge one or more fragments of the append-only log 316 of the storage layer 315. In some embodiments, the log cleaner 314 periodically merges the append-only log 316. In some embodiments, the log cleaner 314 merges the append-only log 316 according to a policy. For example, one policy may be that only the earliest fragments in the append-only log 316 can be used for merging. Another policy may be that only the fragments of the append-only log 316 that contain the least "real-time" data can be used for merging. As described herein, real-time data refers to data that is involved or may be required by active transactions in the DBMS layer 305.

[0070] Once a segment 316a of the append-only log 316 is selected for merging, the log cleaner 314 references the log directory 311 to determine whether the component blocks (pages or deltas) in the log segment 316a can be discarded. Figure 5 , only the append log 316 contains several obsolete component blocks related to page 2 (i.e., blocks 318a, 318b, and 318c) and the reconstructed complete version of page 2, version 8 (i.e., block 318). In this case, redundant blocks 318a, 318b, and 318c can be discarded without losing any useful data because the useful data is still retained in the reconstructed complete block 318.

[0071] like Figure 7 As shown, the tail segment of the append-only log 316b of the storage layer 315 includes the latest written blocks of the append-only log 316, which are page 1, version 1 (block 307) and reconstructed page 2, version 8 (block 318). Figure 7 In the example of , the log cleaner 314 of the storage abstraction layer 310 has selected only the segment 316a of the append log 316 for merging. As shown, the segment 316a contains multiple instances of obsolete data 340 that occupy space in the segment 316a. If a component block is no longer required by any active transaction or any future transaction, it is considered to be obsolete. The segment 316a also contains the third page (i.e., blocks 342a and 342b), the fourth page (i.e., blocks 343a and 343b), and the fifth page (i.e., block 344a).

[0072] For page 3, blocks 342a and 342b may be used to reconstruct the current version of page 3 (represented as complete page 3 version 2 342), which is then appended to the end segment 316b of the append-only log 316. For page 4, a similar process is performed to append the reconstructed complete version of page 4 version 2 343 to the end segment 316b of the append-only log 316. For page 5, there is only one block 344a, so block 344a may be appended to the end segment 316b of the append-only log 316. It should be appreciated that the log directory 311 has been updated to reflect the physical locations of the newly written blocks 342, 343, and 344a for each of pages 3, 4, and 5 as described above.

[0073] Once each of the blocks 342, 343, and 344a have been appended to the end of the append-only log 316, the selected segment 316a of the append-only log 316 becomes redundant, as each block in the segment 316a represents obsolete data or blocks that are redundant by blocks 342, 343, and 344a at the end segment 316b of the append-only log 316. Therefore, the storage abstraction layer 315 discards the segment 316a of the append-only log 316 and notifies the storage layer 315 that the segment 316a is no longer needed, allowing the storage layer 315 to use the segment 316a to store other data. The log cleaner 314 may help to compress and merge the append-only log 316 by removing obsolete and redundant data blocks. The merging of logs can make more efficient use of the append-only storage nodes 110, as well as faster retrieval of pages from the database cluster 106 (because the overhead processing required to rebuild the page from multiple blocks in the append-only log 316 may be reduced or avoided).

[0074] One advantage of the distributed computing system 100 is that it is more flexible in terms of possible implementation configurations of the database. For example, the storage abstraction layer 310 can be implemented in a completely centralized manner or in a distributed manner.

[0075] Figure 8 1 is a block diagram illustrating an exemplary database cluster 806 providing database services with a centralized storage abstraction layer 310. As shown, the storage abstraction layer 310 is fully integrated into the database nodes 108. The storage layer 315 can be integrated into local append-only storage, remote append-only storage nodes 110a, 110b, or any combination thereof. Figure 8 As shown, the storage layer 315 includes a plurality of append-only storage nodes 110 a , 110 b , which are remote from the database node 108 .

[0076] Figure 8The illustrated exemplary embodiment provides a number of advantages. For example, with the storage abstraction layer 310 separate from the various append-only storage nodes 110a, 110b and append-only storage devices 350a, 350b, there are relatively few requirements for the append-only storage devices 350a, 350b to be used with the database cluster 806. The append-only storage devices 350a, 350b are capable of servicing both sequential write requests and random read requests. The remaining functionality of converting page read requests or page write requests from the DBMS layer 305 into log-based operations is handled by the storage abstraction layer 310 on the database node 108, so the append-only storage nodes 110a, 110b do not need to be specially customized. However, in Figure 8 In the configuration shown, if the append-only storage nodes 110a, 110b are located far away from the database node 108, maintaining the database may involve higher network traffic because all read and write operations will occur over the network connection, and reconstruction of the page requires sending each block of the page from the storage layer 315 to the storage abstraction layer 310 over the network connection.

[0077] Fig. 9 1 is a block diagram illustrating an exemplary database cluster 906 that provides database services with a distributed storage abstraction layer 310. As shown, the database cluster 906 is sharded (or partitioned) across multiple append-only storage nodes 110a, 110b. The I / O router 900 maintains a mapping of which storage node 110a, 110b stores each page in the database. The I / O router 900 may be used to receive a page read request or a page write request and forward the request to the storage abstraction layer 310a or 310b on the appropriate storage node 110a, 110b. It should be noted that in Figure 8 and Fig. 9 In the example, log cleaner 314 is optional.

[0078] like Fig. 9 As shown, each storage node 110a, 110b includes a localized storage abstraction layer 310a and 310b, which only manages pages stored in its respective append-only storage devices 350a, 350b. In order to execute a page read request from the DBMS layer 305, the buffer pool 306 issues a page read request for a specific page, and the I / O router 900 looks up the page identifier in the request and determines which append-only storage node 110a, 110b (or shard) stores the requested page. In this example, the requested page is stored on the append-only storage node 110a. Then, the I / O router 900 issues a page read request to the append-only storage node 110a, and the storage abstraction layer 310a processes the page read request according to the above process.

[0079] Fig. 9The technical advantage of the configuration is that scaling is relatively simple. For example, additional append-only storage nodes 110 can be added to Fig. 9 In a system with a relatively small increase in system complexity and a small impact on network traffic. Since the reconstruction of the requested page occurs locally on a specific append-only storage node 110 rather than on the database node 108, Figure 8 The network connection will generate less traffic than the configuration in . In addition, Fig. 9 The configuration reduces the processing load on the database nodes 108 and offloads the processing load to the append-only storage nodes 110, which are more likely to have the processing capacity to accommodate a larger request volume.

[0080] In some embodiments, the storage abstraction layer 310 transparently converts the operation of a traditional database system that stores data on the physical storage devices of a storage node using an in-place update process to operations customized for modern best-only storage nodes (e.g., storage nodes that include SSDs). As described above, append-only storage nodes are more frequently used for storage nodes in data centers. The in-place update process writes the updated page to a "clean" storage block on the append-only storage device, and then clears the old version of the page during garbage collection. Given that the append-only storage device has a limited number of write cycles, using the in-place update process can shorten the life of the append-only storage device of a storage node or shorten the life of a particular block in the append-only storage device of a storage node.

[0081] In accordance with the append-only write operation of some embodiments of the present invention, each new page or page increment is appended to the next available block in the append-only log 316. Therefore, a technical advantage of the system described herein is that each new page or page increment is written sequentially to the append-only log 316, which is faster and more efficient for the append-only storage device 350 than random writes. In addition, compared to random writes during the in-place update process, sequential writes can extend the life of the append-only storage device 350, thereby reducing the cost of operating the database because the time required to replace components may be extended. In addition, the append-only storage device 350 can perform "random read" operations (i.e., read operations from non-sequential storage blocks) at speeds comparable to those of an HDD, which allows the use of the append-only storage device 350 to complete the data retrieval required for page read operations at a faster speed than an HDD.

[0082] In addition, as shown in the exemplary embodiments described herein, the system described herein can be relatively easily adapted to different storage layer implementations, different database systems, sharded or non-sharded databases, and can be relatively easily expanded in storage size without pre-reserving resources.

[0083] Because DMBS layer 305 is isolated from storage layer 315, system described herein allows to be more flexible in how to store data physically. For example, any combination of only appending storage device 350, cloud storage or custom storage node of local appending can be used. In addition, data can be partitioned or fragmented across multiple only appending storage nodes 110. In addition, embodiments described herein can support multiple database systems, including but not limited to MySQL, PostgreSQL etc.

[0084] In addition, in some embodiments, the storage abstraction layer 310 is used with other types of databases (e.g., key-value storage databases). In embodiments using a key-value storage database, the storage abstraction layer 310 can receive read and write record requests from the DMBS layer 305, and the storage abstraction layer 310 converts the read and write record requests into append and read component instructions, which are sent to the storage layer 315.

[0085] In addition, the embodiments disclosed herein are compatible with various replication schemes. In some embodiments, the storage abstraction layer 310 controls the replication operation. For example, the storage abstraction layer 310 can handle the replication operation by sending each page write request to multiple append-only storage nodes 110. In some embodiments, the replication operation can be implemented by the storage layer 315. The embodiments disclosed herein can support consistent (a write operation must be written to all copies of the component block to be considered completed) arbitration-based (a write operation must be written to a threshold number of copies of the component block to be considered completed) replication schemes.

[0086] The scope of the present application is not limited to the specific embodiments of the processes, machines, manufactures, material compositions, components, methods and steps described in the specification. A person skilled in the art can easily understand from the disclosure of the present invention that existing or to-be-developed processes, machines, manufactures, material compositions, components, methods or steps that have substantially the same functions as the corresponding embodiments described herein or can achieve substantially the same results as the embodiments described can be used according to the present invention. Accordingly, the scope of the appended claims includes such processes, machines, manufactures, material compositions, components, methods or steps.

[0087] It is to be understood that the detailed embodiments described and illustrated above are only examples. Variations, alternative configurations, alternative components and modifications may be made to these exemplary embodiments. The present invention is defined by the claims.

Claims

1. A device, characterized in that: include: one or more processors; The memory stores processor-executable instructions, and when the one or more processors execute the instructions, the one or more processors perform the following operations: receiving a page write request associated with one or more component blocks of a page; The log writer determines a logical identifier corresponding to the page in the log directory; The log writer sends each corresponding component block of the one or more component blocks to a storage node for sequentially appending the one or more component blocks to an append-only storage log of the storage node; receiving, from the storage node, a physical storage location of each of the one or more component blocks; In the log directory, the physical storage location of each component block in the one or more component blocks is associated with the logical identifier corresponding to the page.

2. The device according to claim 1, characterized in that The processor-executable instructions further cause the one or more processors to: receiving a page read request associated with the page; The log directory determines the physical storage location of one or more component blocks of the requested page in the storage node; The page reader retrieves the one or more component blocks of the requested page from the storage node according to the physical storage locations of the one or more component blocks; Return to the requested page.

3. The device according to claim 2, characterized in that The one or more component chunks of the requested page include at least two component chunks, wherein returning the requested page includes reconstructing, by the page reader, the requested page from the at least two component chunks.

4. The device according to claim 3, characterized in that The processor-executable instructions further cause the one or more processors to: The log writer sends the reconstructed page to the storage node for appending to an append-only storage log of the storage node.

5. The device according to claim 3, characterized in that The at least two component chunks are retrieved from the storage nodes in parallel.

6. The device according to any one of claims 1 to 5, characterized in that The component blocks include one or more of full pages and page increments.

7. The device according to claim 1, characterized in that The storage node is far away from the database node.

8. The device according to claim 1, characterized in that The storage node is a local node of the database node.

9. The device according to claim 1, characterized in that The device is integrated into one of the database node and the storage node.

10. The device according to claim 1, characterized in that The processor-executable instructions further cause the one or more processors to: The log cleaner collects at least one real-time data block from the append-only storage log segment; The at least one real-time data block is sent to the storage node for appending to the end of the append-only storage log.

11. The device according to claim 10, characterized in that The at least one real-time data block includes at least two real-time data blocks, wherein sending the at least one real-time data block to the storage node for appending includes reconstructing a real-time page through the at least two real-time data blocks, and sending the reconstructed real-time page to the storage node.

12. The device according to claim 10, characterized in that The processor-executable instructions further cause the one or more processors to: The storage node is notified to clean up the segment of the append-only storage log.

13. A method, characterized in that include: A database node receives a page write request associated with one or more component blocks of a page; Determine a logical identifier corresponding to the page in the log directory; sending each corresponding component block of the one or more component blocks to a storage node for sequentially appending the one or more component blocks to an append-only storage log of the storage node; receiving, from the storage node, data indicating a physical storage location of each of the one or more component blocks; In the log directory, the physical storage location of each component block in the one or more component blocks is associated with the logical identifier corresponding to the page.

14. The method according to claim 13, characterized in that Also includes: If the database node receives a page read request associated with a page: The log directory determines the physical storage location of one or more component blocks of the requested page in the storage node; retrieving the one or more component blocks of the requested page from the storage node according to the physical storage locations of the one or more component blocks; Return to the requested page.

15. The method according to claim 14, characterized in that The one or more component chunks of the requested page include at least two component chunks, wherein returning the requested page includes reconstructing, by the page reader, the requested page from the at least two retrieved component chunks.

16. The method according to claim 15, characterized in that Also includes: The reconstructed page is sent to the storage node for appending to the append-only storage log of the storage node.

17. The method according to claim 15, characterized in that The at least two component chunks are retrieved from the storage nodes in parallel.

18. The method according to any one of claims 13 to 17, characterized in that The component blocks include one or more of full pages and page increments.

19. The method according to claim 13, characterized in that The storage node is remote from the database node.

20. The method according to claim 13, characterized in that The storage node is a local node of the database node.

21. The method according to claim 13, characterized in that Also includes: Collecting at least one real-time data block from the segment of the append-only storage log in the storage node; The at least one real-time data block is sent to the storage node for appending to the end of the append-only storage log.

22. The method according to claim 21, characterized in that The at least one real-time data block includes at least two real-time data blocks, wherein sending the at least one real-time data block to the storage node for appending includes reconstructing a real-time page through the at least two real-time data blocks, and sending the reconstructed real-time page to the storage node.

23. The method according to claim 21, characterized in that Also includes: The storage node is notified to clean up the segment of the append-only storage log on the storage node.

24. A computer-readable medium comprising instructions, characterized in that: When the instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 13 to 22.