Database persistence
By using non-persistent and persistent storage devices in the storage subsystem, real-time updates of the database and its mirror are achieved, solving the problems of the inability to provide a continuously updated complete copy and performance loss in the prior art, and improving the durability and performance of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2026-03-17
AI Technical Summary
Existing database persistence methods cannot provide continuously updated complete copies, and the AOF method causes performance loss during update operations, affecting system performance.
By using non-persistent memory devices and persistent memory devices in the memory subsystem to store and maintain the database and its mirror respectively, real-time updates to the database and delayed reflection of the mirror are achieved. The characteristics of persistent memory devices are used to ensure that the mirror does not fully reflect changes for a short period of time after the database is changed.
It provides a reliable and complete mirror of the database, improving the persistence and performance of the system's operational levels and avoiding the performance loss caused by the AOF method.
Smart Images

Figure CN115827689B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure generally relate to a memory subsystem, and more specifically, to a memory subsystem for database persistence. Background Technology
[0002] A memory subsystem may include one or more memory devices for storing data. Memory devices may be, for example, non-volatile memory devices and volatile memory devices. Generally, a host system can utilize a memory subsystem to store data at memory devices and retrieve data from memory devices. Summary of the Invention
[0003] According to one embodiment of this disclosure, a method for database persistence is provided. The method includes updating, in response to a set command associated with a keyword value library, the following: the keyword value library maintained on a non-persistent storage device of a storage subsystem; and a mirror of the keyword value library maintained on a persistent storage device of the storage subsystem. The method further includes retrieving values of keywords from the keyword value library maintained on the non-persistent device in response to a get command associated with the keyword value library.
[0004] According to one embodiment of this disclosure, an apparatus for database persistence is provided. The apparatus includes a non-persistent storage device configured to store read and write versions of a database; and a persistent storage device configured to simultaneously store a write-only version of the database along with the read and write versions of the database stored on the non-persistent storage device.
[0005] According to one embodiment of this disclosure, a system for database persistence is provided. The system includes a host system comprising a processing device and a storage subsystem. The storage subsystem includes a non-persistent storage device coupled to the host system and configured to store a key-value database; and a persistent storage device coupled to the host system and configured to store a mirror image of the key-value database. The host system is configured to: in response to a get command from the processing device, cause a request for a key value of the key-value database to be provided to the non-persistent storage device; in response to the get command, cause a request for a key value of the key-value database not to be provided to the non-persistent storage device; and in response to a set command from the processing device, cause updates to the key-value database to be provided simultaneously to the non-persistent storage device and the persistent storage device.
[0006] According to one embodiment of this disclosure, a non-transitory medium is provided for storing instructions for database persistence. The non-transitory medium can be executed by a processing device to: maintain a primary dictionary of the database on a non-persistent storage device; maintain a secondary dictionary of the database on a persistent storage device; retrieve values from the database only from the primary dictionary; and simultaneously reflect updates to the database in both the primary dictionary maintained on the non-persistent storage device and the secondary dictionary maintained on the persistent storage device. Attached Figure Description
[0007] This disclosure will be more fully understood in light of the detailed description provided below and the accompanying drawings of various embodiments thereof.
[0008] Figure 1 This describes an example computing system including a memory subsystem according to some embodiments of the present disclosure.
[0009] Figure 2 This is a block diagram of a system for database persistence according to some embodiments of the present disclosure.
[0010] Figure 3 This is a block diagram representing a key-value store according to some embodiments of the present disclosure.
[0011] Figure 4 This is a block diagram representing a system for database persistence according to some embodiments of the present disclosure.
[0012] Figure 5 This is a flowchart corresponding to a method for database persistence according to some embodiments of this disclosure.
[0013] Figure 6 This is a block diagram of an example computer system in which embodiments of the present disclosure can be operated. Detailed Implementation
[0014] This disclosure relates to a memory subsystem, and more particularly, to a memory subsystem comprising a memory subsystem database persistence component. The memory subsystem may be a storage system, a storage device, a memory module, or a combination thereof. An example of a memory subsystem is a storage system such as a solid-state drive (SSD). The following description... Figure 1 And other instances describing storage devices and memory modules. Generally, a host system may utilize a memory subsystem that includes one or more components, such as a memory device for storing data. The host system can provide data to be stored in the memory subsystem and can request to retrieve data from the memory subsystem.
[0015] The memory device can be a non-volatile memory device. An example of a non-volatile memory device is a three-dimensional cross-point memory device containing a cross-point array of non-volatile memory cells. The following section combines... Figure 1 Other examples of non-volatile memory devices are described. A non-volatile memory device (e.g., a three-dimensional intersection memory device) can be a package of one or more memory components (e.g., memory dies). Each die can consist of one or more planes. Planes can be divided into logical units. For example, a non-volatile memory device can be assembled from multiple memory dies, each of which can form a component of the memory device.
[0016] Memory devices can be non-volatile memory devices. An example of a non-volatile memory device is a NAND flash memory device (also known as flash memory). The following text... Figure 1 Other examples of nonvolatile memory devices are described in connection with this description. A nonvolatile memory device is a package of one or more dies. Each die may consist of one or more planes. Planes may be grouped into logical units (LUNs). For some types of nonvolatile memory devices (e.g., NAND devices), each plane consists of a set of physical blocks. Each block consists of a set of pages. Each page consists of a set of memory cells (“cells”). A cell is an electronic circuit that stores information. Hereinafter, a block refers to a cell of a memory device used to store data and may contain groups of memory cells, groups of word lines, word lines, or individual memory cells. For some memory devices, a block (also referred to hereafter as a “memory block”) is the smallest erasable area. Pages cannot be erased individually; only the entire block can be erased.
[0017] Each memory device may contain one or more arrays of memory cells. Depending on the cell type, a cell may store one or more bits of binary information and has various logical states associated with the number of bits stored. Logical states may be represented by binary values (e.g., "0" and "1" or combinations thereof). Various types of cells exist, such as single-level cell (SLC), multi-level cell (MLC), three-level cell (TLC), and four-level cell (QLC). For example, an SLC may store one bit of information and have two logical states.
[0018] Some NAND memory devices employ a floating gate architecture, where memory access is controlled based on the relative voltage variation between the bit line and the word line. Other examples of NAND memory devices may employ alternative gate architectures that may include word line layouts that allow for the trapping of charges corresponding to data values within the memory cell based on the properties of the materials used to construct the word lines.
[0019] Some previous methods of database persistence may have included database files based on snapshots of the database. These snapshots can be used as backups of the database. A snapshot may be a copy of the entire database at the time the snapshot was created. Database changes that occurred between the creation of the snapshot may not be reflected in the snapshot. In response to a request for data values in the database, data values can be retrieved from the database but not from the snapshot.
[0020] In some previous methods of database persistence, an append-only file (AOF) was generated. The AOF of the database is updated when data values in the database are updated. The AOF can be analogous to a write log written to the database. Unlike a database snapshot, the AOF may not be a copy of the database. In fact, the AOF can be used to refactor the database. AOF can be a more durable method of database persistence than snapshots because every write to the database is recorded in the AOF. Maintaining the AOF of the database can adversely affect the performance of the system hosting and / or maintaining the database. AOF can be a more durable means of providing persistent data because every SET operation is recorded in the AOF. However, the generation of AOF can cause a significant performance penalty because each SET operation needs to be transported through the storage stack of the operating system (OS) (e.g., performed by the host system) to the AOF. Some previous methods may have included a combination of database snapshots and AOF. However, previous methods utilizing both snapshots and AOF do not provide a complete copy of the continuously updated database.
[0021] This disclosure addresses the above and other deficiencies by providing a storage subsystem that maintains a complete copy of a continuously updated database. For example, in some embodiments, the database may be stored on a storage device of the storage subsystem, and a mirror image of the database may be stored on a persistent storage device. As used herein, "persistent storage" or "persistent storage device" refers to non-volatile memory or a storage device, respectively. As used herein, "non-persistent storage" or "non-persistent storage device" refers to volatile memory or a storage device, respectively. As used herein, a "mirror image" of the database refers to a copy of the database, wherein changes to the mirror image may lag slightly behind changes to the database. For example, characteristics (e.g., physical characteristics, electrical characteristics) of the persistent storage device storing the mirror image of the database may cause the mirror image to not fully reflect changes to the database stored on the non-persistent storage device for a short period of time (e.g., nanoseconds) after a database change.
[0022] A mirror of the database stored on a persistent storage device can be updated simultaneously with an update to the database stored on a non-persistent storage device. At the same time, changes to one or more data values in the database stored on the non-persistent storage device are reflected in the mirror of the database stored on the persistent storage device. However, data values can be retrieved from the database stored on the non-persistent storage device, rather than from the mirror of the database stored on the persistent storage device. The non-persistent storage device serves requests for one or more data values from the database.
[0023] A non-limiting example of a database described herein is a keyword value library. A keyword value library can be a data storage mechanism for storing data in an associative memory array (IMA), retrieving data from an IMA, and / or managing an IMA. The keyword value library can utilize a dictionary data structure to store keyword-value pairs. Setting operations can be performed in response to setting commands, such as creating one or more values for one or more keywords and / or updating one or more values for one or more keywords in the keyword value library. Retrieval operations can be performed in response to GET commands, such as retrieving one or more values for one or more keywords from the keyword value library. Some embodiments of this disclosure may include maintaining keyword value libraries in two dictionaries. Setting and retrieval operations can be performed using the keyword value library maintained as a primary dictionary. Setting operations can be performed using a mirror of the keyword value library maintained as a secondary dictionary instead of retrieval operations. The address area of the secondary dictionary can be mapped to a persistent memory device of the memory subsystem. Maintaining a mirror of the keyword value library as a secondary dictionary provides faster operation-level persistence compared to previous methods including AOF persistence.
[0024] Figure 1 This description describes an example computing system 100 including a memory subsystem 110 according to some embodiments of the present disclosure. The memory subsystem 110 may include media, such as one or more volatile memory devices (e.g., non-persistent memory devices 140), one or more non-volatile memory devices (e.g., persistent memory devices 130), or combinations thereof.
[0025] The memory subsystem 110 may be a storage device, a memory module, or a combination of both. Examples of storage devices include solid-state drives (SSDs), flash drives, universal serial bus (USB) flash drives, embedded multimedia controller (eMMC) drives, universal flash memory (UFS) drives, secure digital cards (SD cards), and hard disk drives (HDDs). Examples of memory modules include dual in-line memory modules (DIMMs), small form factor DIMMs (SO-DIMMs), and various types of non-volatile dual in-line memory modules (NVDIMMs).
[0026] The computing system 100 may be a computing device, such as a desktop computer, a laptop computer, a server, a web server, a mobile device, a vehicle (e.g., an airplane, a drone, a train, a car or other means of transport), a device with Internet of Things (IoT) capabilities, an embedded computer (e.g., an embedded computer contained in a vehicle, industrial equipment or a networked business device), or such a computing device containing memory and processing devices.
[0027] The computing system 100 may include a host system 120 coupled to one or more memory subsystems 110. In some embodiments, the host system 120 is coupled to different types of memory subsystems 110. Figure 1 This describes an example of a host system 120 coupled to a memory subsystem 110. As used herein, “coupled to…” or “coupled with…” generally refers to a connection between components, which can be an indirect or direct communication connection (e.g., without an intervening component), whether wired or wireless, and includes connections such as electrical, optical, and magnetic connections.
[0028] The host system 120 may include a processor chipset and a software stack executed by the processor chipset. The processor chipset may include one or more cores, one or more cache memories, a memory controller (e.g., an SSD controller), and a storage protocol controller (e.g., a PCIe controller, a SATA controller). The host system 120 uses, for example, a memory subsystem 110 to write data to and read data from the memory subsystem 110.
[0029] Host system 120 may be coupled to memory subsystem 110 via a physical host interface. Examples of physical host interfaces include, but are not limited to, Serial Advanced Technology Attachment (SATA) interfaces, Peripheral Component Interconnect High Speed (PCIe) interfaces, Universal Serial Bus (UFS) interfaces, Fibre Channel, Serial Attached SCSI (SAS), Small Computer System Interface (SCSI), Dual Data Rate (DDR) memory bus, Dual In-line Memory Module (DIMM) interfaces (e.g., DDR-enabled DIMM sockets), Open NAND Flash Interface (ONFI), Low Power Dual Data Rate (LPDDR), or any other interface. The physical host interface can be used to transmit data between host system 120 and memory subsystem 110. When memory subsystem 110 is coupled to host system 120 via a PCIe interface, host system 120 may further utilize NVM High Speed (NVMe) interface access components (e.g., persistent storage device 130). The physical host interface provides an interface for transferring control, address, data, and other signals between memory subsystem 110 and host system 120. Figure 1The memory subsystem 110 is described as an example. Generally, the host system 120 can access multiple memory subsystems via the same communication connection, multiple separate communication connections, and / or a combination of communication connections.
[0030] The persistent memory device 130 and the non-persistent memory device 140 may each comprise any combination of different types of non-volatile memory devices and volatile memory devices. Some examples of volatile memory devices may be, but are not limited to, random access memory (RAM), such as dynamic random access memory (DRAM) and synchronous dynamic random access memory (SDRAM).
[0031] Examples of non-volatile memory devices include NAND flash memory and in-place write memory, such as three-dimensional cross-point ("3D cross-point") memory devices, which are cross-point arrays of non-volatile memory cells. Cross-point arrays of non-volatile memory can be combined with stackable cross-grid data access arrays to perform bit storage based on changes in volume resistance. Furthermore, compared to many flash-based memories, cross-point non-volatile memory can perform in-place write operations, where non-volatile memory cells can be programmed without pre-erasing them. NAND flash memory includes, for example, two-dimensional NAND (2D NAND) and three-dimensional NAND (3D NAND).
[0032] The persistent memory device 130 may include one or more arrays of memory cells. One type of memory cell, such as a single-level cell (SLC), may store one bit per cell. Other types of memory cells, such as multi-level cell (MLC), three-level cell (TLC), four-level cell (QLC), and five-level cell (PLC), may store multiple bits per cell. In some embodiments, the persistent memory device 130 may include one or more arrays of memory cells, such as SLC, MLC, TLC, QLC, or any combination thereof. In some embodiments, a particular memory device may include an SLC portion, an MLC portion, a TLC portion, a QLC portion, or a PLC portion of memory cells. The memory cells of the memory device 130 may be grouped into pages, and a page may refer to a logical cell of the corresponding memory device used to store data. For some types of memory (e.g., NAND), pages may be grouped to form blocks.
[0033] While non-volatile memory components, such as three-dimensional cross-point arrays of non-volatile memory cells and NAND-type memories (e.g., 2D NAND, 3D NAND), are described, persistent memory device 130 may be based on any other type of non-volatile memory or storage device, such as read-only memory (ROM), phase-change memory (PCM), auto-select memory, other chalcogenide-based memories, ferroelectric transistor random access memory (FeTRAM), ferroelectric random access memory (FeRAM), magnetic random access memory (MRAM), spin-transfer torque (STT)-MRAM, conductive bridged RAM (CBRAM), resistive random access memory (RRAM), oxide-based RRAM (OxRAM), NOR flash memory, and electrically erasable programmable read-only memory (EEPROM).
[0034] The memory subsystem controller 115 can communicate with memory device 130 and persistent memory device 131 to perform operations such as reading data (e.g., a get operation), writing data (e.g., a set operation), and / or erasing data stored in persistent memory device 130 and non-persistent memory device 140 (e.g., a set operation), and other such operations. The memory subsystem controller 115 may include hardware such as one or more integrated circuits and / or discrete components, buffer memories, or combinations thereof. The hardware may include digital circuitry with dedicated (i.e., hard-decoded) logic to perform the operations described herein. The memory subsystem controller 115 may be a microcontroller, a dedicated logic circuit system (e.g., a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc.), or other suitable processor.
[0035] The memory subsystem controller 115 may include a processor 117 (e.g., a processing device) configured to execute instructions stored in local memory 119. In the illustrated example, the local memory 119 of the memory subsystem controller 115 includes embedded memory configured to store instructions for executing various processes, operations, logic flows, and routines that control the operation of the memory subsystem 110, including handling communication between the memory subsystem 110 and the host system 120.
[0036] In some embodiments, local memory 119 may include memory registers storing memory pointers, fetched data, etc. Local memory 119 may also include read-only memory (ROM) for storing microcode. Although in Figure 1The instance memory subsystem 110 has been described as including a memory subsystem controller 115, but in another embodiment of this disclosure, the memory subsystem 110 does not include a memory subsystem controller 115, but instead may rely on external control (e.g., provided by an external host or by a processor or controller separate from the memory subsystem).
[0037] Generally, the memory subsystem controller 115 can receive commands or operations from the host system 120 and can translate these commands or operations into instructions or appropriate commands to enable desired access to memory devices 130 and / or 140. The memory subsystem controller 115 may be responsible for other operations, such as wear leveling, garbage collection, error detection and error correction (ECC) operations, encryption, caching, and address translation between logical addresses (e.g., logical block addresses (LBAs), namespaces) and physical addresses (e.g., physical block addresses, physical media orientations, etc.) associated with persistent memory device 130. The memory subsystem controller 115 may additionally include a host interface circuitry for communicating with the host system 120 via a physical host interface. The host interface circuitry can translate commands received from the host system 120 into command instructions for accessing persistent memory device 130 and / or non-persistent memory device 140, and translate information associated with persistent memory device 130 and / or non-persistent memory device 140 into information for use by the host system 120.
[0038] The memory subsystem 110 may also include additional circuitry or components not described. In some embodiments, the memory subsystem 110 may include caches or buffers (e.g., DRAM) and address circuitry (e.g., row decoders and column decoders) that can receive addresses from the memory subsystem controller 115 and decode the addresses to access persistent memory device 130 and / or non-persistent memory device 140.
[0039] In some embodiments, persistent memory device 130 includes a local media controller 135, which operates in conjunction with memory subsystem controller 115 to perform operations on one or more memory cells of persistent memory device 130. An external controller (e.g., memory subsystem controller 115) may externally manage memory device 130 (e.g., perform media management operations on memory device 130). In some embodiments, persistent memory device 130 may be a managed memory device. A managed memory device is a raw memory device combined with a local controller (e.g., local controller 135) for media management within the same memory device package. An example of a managed memory device is a managed NAND (MNAND) device.
[0040] The storage subsystem 110 may include a database persistence component 113. Although Figure 1 Not shown, but the database persistence component 113 may include circuitry that facilitates the maintenance of a mirror image of the database stored on the non-persistent memory device 140 and the database stored on the persistent memory device 130. In some embodiments, the database persistence component 113 may include dedicated circuitry in the form of, for example, an ASIC, an FPGA, a state machine, and / or other logic circuitry that enables the database persistence component 113 to update and retrieve data values of the database stored on the non-persistent memory device 140 and to update, rather than retrieve, the data values of the mirror image of the database stored on the persistent memory device 130. However, the database can be recovered by retrieving the data values of the mirror image of the database from the persistent memory device 130 via the database persistence component 113 or another component of the computing system 100.
[0041] In some embodiments, the memory subsystem controller 115 includes at least a portion of the database persistence component 113. For example, the memory subsystem controller 115 may include a processor 117 (e.g., a processing means) configured to execute instructions stored in local memory 119 for performing the operations described herein. In some embodiments, the database persistence component 113 may be part of the host system 120, an application, or an operating system.
[0042] In a non-limiting instance, the device (e.g., computing system 100) may include a database persistence component 113. The database persistence component 113 may reside on a memory subsystem 110. As used herein, the term "resides on" means that something is physically located on a particular component. For example, "resides on memory subsystem 110" means that the hardware circuitry including the database persistence component 113 is physically located on memory subsystem 110. The term "resides on" may be used interchangeably herein with other terms such as "deployed on" or "located on".
[0043] Database persistence component 113 may be configured to cause updates and / or retrieval of data values in a database stored on non-persistent memory device 140. Database persistence component 113 may be configured to cause a corresponding update of a mirror image of the database stored on persistent memory device 130 in parallel with and / or in response to updates to the database stored on non-persistent memory device 140. As described above, memory components may be memory dies or memory packages forming at least a portion of non-persistent memory device 140 and / or persistent memory device 130. In some embodiments, memory subsystem 110 may include memory components arranged to form a stackable cross-grid memory cell array.
[0044] In some embodiments, the database persistence component 113 may be configured to cause one or more data values stored in a database on a non-persistent storage device 140 to be removed from the database based on the data temperature of the data values. As used herein, the metadata's "data temperature" corresponding to a data value indicates the likelihood that the data value has been accessed recently (e.g., read, written, erased). Data values that have not been accessed recently (e.g., have not been accessed within a threshold time period) have a decreased or lower data temperature, while data values that have been accessed recently (e.g., have been accessed within a threshold time period) have an increased or higher data temperature. The database persistence component 113 may be configured to cause the data values stored in the database on the non-persistent storage device 140 and all data values stored in the database on the persistent storage device 130 to be maintained based on the corresponding data temperature of the data values, regardless of the data temperature of the data values. The database persistence component 113 may be configured to cause the data values stored in the database on the non-persistent storage device 140 to be removed from the database on the non-persistent storage device 140 in response to the data temperature of a data value falling below a threshold data temperature.
[0045] Figure 2 This is a block diagram of a system for database persistence according to some embodiments of the present disclosure. The host system 220, non-persistent storage device 240, and persistent storage device 230 may be similar to... Figure 1 The host system 120, non-persistent storage device 140, and persistent storage device 130 are described in association.
[0046] According to several database persistence schemes described herein, database 245 can be stored and maintained on non-persistent memory device 240. Database 245 can be an in-memory database. As used herein, "in-memory database" means a database maintained in main memory. Figure 2 Note that the non-persistent memory device 240 may be DRAM. A mirror image 247 of the database 245 may be stored and maintained on the persistent memory device 230. The persistent memory device 230 may include a non-volatile memory cell cross-point array on which the mirror image 247 of the database 245 may be stored.
[0047] Host system 220 may be coupled to non-persistent storage device 240 and persistent storage device 230. Host system 220 may include database core engine 242. Database core engine 242 may include circuitry, firmware, software, and combinations thereof. Database core engine 242 may be configured to send database management commands, such as read commands (e.g., get commands), write commands (e.g., set commands), and / or erase data (e.g., set commands), to non-persistent storage device 240 and persistent storage device 230. Database core engine 242 may include memory allocator 243. Memory allocator 243 may include circuitry, firmware, software, and combinations thereof. Database core engine 242 uses memory allocator 243 to send database management commands to non-persistent storage device 240 and / or persistent storage device 230. For example, memory allocator 243 allocates and / or deals with memory for data values corresponding to addresses in non-persistent memory device 240, such that the execution of commands issued by the database core engine 242 writes and / or erases data values in database 245 to non-persistent memory device 240. Memory allocator 243 also allocates and / or deals with memory for data values corresponding to addresses in persistent memory device 230, such that the same commands sent to persistent memory device 230 simultaneously update the mirror 247 of database 245. Therefore, any changes to database 245 are often reflected in the mirror 247 of database 245 almost simultaneously.
[0048] Simultaneously updating the database 245 stored on the non-persistent storage device 240, a mirror 247 of the database 245 stored on the persistent storage device 230 is also updated, providing a reliable, complete mirror 247 of the database 245. To restore the database 245, it can be loaded from the mirror 247 of the database 245 stored on the persistent storage device 230 onto the persistent storage device 240. The database 245 can be loaded from the persistent database 247 onto the non-persistent storage device 240 without compression. The persistent storage devices 230 and 240 can have similar write speeds so that the persistent storage device 230 can keep up with the commands sent from the data core engine 242 to both the non-persistent storage devices 240 and 230. While the non-persistent storage device 240 may be able to have a faster write speed than the persistent storage device 230, the persistent storage device 230 is not a bottleneck based on the throughput of the data core engine 242.
[0049] While some persistent storage devices (e.g., 3-D cross-point memory devices) provide fast access to the data stored thereon, other storage devices (e.g., non-persistent storage devices) provide even faster access to the data stored thereon. Therefore, to provide fast access to data values maintained in both database 245 and its mirror 247, the database core engine 242 can be configured to provide commands to retrieve (e.g., read) data values from non-persistent storage device 240 and non-persistent storage device 230. (As provided by...) Figure 2 Note that the set command 257 is provided to both the non-persistent memory device 240 and the persistent memory device 230. In contrast, the obtain command 256 is provided to the non-persistent memory device 240, but not to the non-persistent memory device 230.
[0050] In some embodiments, another persistent storage device (e.g., by...) Figure 2 The SSD 248 described herein may be coupled to persistent storage device 230. A copy 249 of a mirror 247 of database 245 may be stored and maintained on SSD 248. An update to mirror 247 of database 245 may trigger a corresponding update to copy 249 of mirror 247 of database 245 stored on SSD 248. Because SSD 248 may not have the same write speed as non-persistent storage device 240 and persistent storage device 230, SSD 248 serves only as spare capacity by storing copy 249 of mirror 247 of database 245.
[0051] Figure 3 This is a block diagram representing a keyword value library 350 according to some embodiments of the present disclosure. A keyword value library is a type of application capable of managing an associative memory array. For example, keyword value library 350 may store keyword value pairs of multiple value types (e.g., strings, lists). Keyword value library 350 may include a data structure called a dictionary storing keyword value pairs. Figure 3 As explained, the keyword value library 350 can be a primary dictionary 351 and a secondary dictionary 353. (As with...) Figure 2 As described in connection, the primary dictionary 351 may resemble database 245 and the secondary dictionary may resemble a mirror image 247 of database 245. The primary dictionary 351 may be stored on a non-persistent memory device (e.g., non-persistent memory device 240). The secondary dictionary 353 may be stored on a persistent memory device (e.g., persistent memory device 230).
[0052] Keyword value library 350 can be used as a cache (e.g., a volatile cache) to improve the performance of the host system (e.g., host system 220) by storing computational or data in memory. By maintaining the primary dictionary 351 and the secondary dictionary 353, some embodiments of this disclosure can provide applications that do not require data persistence (e.g., executed by host system 220) as well as applications that require data persistence because the data cannot be recovered after a host system crash or restart.
[0053] A dictionary may contain one or more hash tables. For example, such as... Figure 3 The primary dictionary 351 may contain hash tables 352-0 and 352-1, and the secondary dictionary 353 may contain hash table 354-0. Hash tables 352-0, 352-1, and 354-0 can be used to retrieve, update, and / or manage key-value pairs. In some prior methods, the dictionary may be stored only in non-persistent memory. In contrast, some embodiments of this disclosure involve storing the primary dictionary 351 in non-persistent memory and storing the secondary dictionary 353 in persistent memory. The secondary dictionary 353 may be a mirror image of the primary dictionary 351.
[0054] As by Figure 3 The secondary dictionary 353 can be used to copy and execute the setup operation 357 performed using the primary dictionary 351. However, the get operation 356 performed using the primary dictionary 351 is not copied. Memory allocations for the secondary dictionary 353 can be mapped to address ranges of persistent memory. Therefore, the secondary dictionary 353 provides persistent data. While the performance of a computing system utilizing the secondary dictionary 353 can be limited by persistent memory access latency, the secondary dictionary 353 enables some embodiments of this disclosure to have lower access latency compared to prior methods.
[0055] Figure 4 This is a block diagram illustrating a system for database persistence according to some embodiments of the present disclosure. The host system 420, non-persistent storage device 440, and persistent storage device 430 may be similar to... Figure 2 The host system 220, non-persistent storage device 240, and persistent storage device 230 are described in association.
[0056] The host system 420 may include a processing unit 460. The processing unit 460 may be a central processing unit (CPU). The host system 420 may include a crossbar (XBar) 461. The crossbar 461 may include software, hardware, and combinations thereof. Although Figure 4 Unless otherwise specified, host system 420 may include a memory allocator (e.g., with...). Figure 2The memory allocator 243 is described in association. For example, the memory allocator may be part of the cross switch 461. (As with...) Figure 2-3 Relatedly, the database (e.g., a key-value library) may be stored and maintained on non-persistent storage device 440. A mirror image of the database stored on non-persistent storage device 440 may be stored on persistent storage device 430.
[0057] Host system 420 can be configured to, in response to a get command from processing device 460, cause requests for values of keywords in the keyword value library to be provided only to non-persistent memory device 440. Host system 420 can be configured to associate a corresponding request for a keyword value with a first address within a first address range of non-persistent memory device 440. Host system 420 can be configured to, in response to a set command from processing device 460, cause updates to the keyword value library to be provided to both non-persistent memory device 440 and persistent memory device 430. Host system 420 can be configured to associate corresponding updates to the keyword value library with a second address within the first address range of non-persistent memory device 440 and a third address within the second address range of persistent memory device 430.
[0058] Crosstalk switch 461 can be configured to route a corresponding request for a key value in the key value library to non-persistent memory device 440 based on a corresponding first address. Crosstalk switch 461 can be configured to route a corresponding update to the key value library to non-persistent memory device 440 based on a corresponding second address. Crosstalk switch 461 can be configured to route a corresponding update to the key value library to persistent memory device 430 based on a corresponding third address. Crosstalk switch 461 can be configured to map bytes corresponding to the key values in the key value library to addresses in non-persistent memory device 440 or persistent memory device 430.
[0059] Figure 5 This is a flowchart corresponding to a method 570 for database persistence according to some embodiments of the present disclosure. Method 570 may be executed by processing logic, which may include hardware (e.g., processing device, circuit system, dedicated logic, programmable logic, microcode, device hardware, integrated circuit, etc.), software (e.g., instructions that run or execute on the processing device), or a combination thereof. In some embodiments, method 570 is performed by... Figure 1The database persistence component 113, described in association, is executed. Although shown in a specific order or sequence, the order of the processes may be modified unless otherwise specified. Therefore, it should be understood that the illustrated embodiments are merely examples, and the illustrated processes may be performed in different orders, and some processes may be performed in parallel. Furthermore, one or more processes may be omitted in various embodiments. Therefore, not all processes are required in every embodiment. Other process flows are also possible.
[0060] At operation 571, in response to a setting command associated with the key value library, the mirror of the key value library maintained on the non-persistent memory device of the memory subsystem and the key value library maintained on the persistent memory device of the memory subsystem can be updated simultaneously. In some embodiments, the memory subsystem may be similar to... Figure 1 The memory subsystem 110 is described in association. In response to updating a copy of the key value library maintained on a persistent storage device, a copy of the key value library value maintained on an SSD coupled to the persistent storage device can be updated.
[0061] At operation 573, in response to a retrieve command associated with the keyword value library, the value of a keyword can be retrieved from the keyword value library maintained on a non-persistent memory device. In some embodiments, method 570 may include loading the keyword value library onto the non-persistent memory device using a mirror of the keyword value library maintained on a persistent memory device.
[0062] Figure 6 This is a block diagram of an example computer system 661 in which embodiments of the present disclosure are operable. For example, Figure 6 An example machine describing computer system 661 is described, capable of executing a set of instructions within said computer system 661 for causing said machine to perform any one or more of the methods discussed herein. In some embodiments, computer system 661 may correspond to a host system (e.g., with) a memory subsystem (e.g., memory subsystem 110) that includes, is coupled to, or utilizes a memory subsystem (e.g., memory subsystem 110) or is available to perform controller operations (e.g., to execute an operating system to perform operations corresponding to database persistence component 113). Figure 1 (Host system 120 described in association). In alternative embodiments, the machine may be connected (e.g., networked) to other machines in a LAN, intranet, extranet, and / or the Internet. The machine may operate as a peer machine in a peer-to-peer (or distributed) network environment or as a server or client machine in a cloud computing infrastructure or environment, operating at the capacity of a server or client machine in a client-server network environment.
[0063] The machine may be a personal computer (PC), tablet PC, set-top box (STB), personal digital assistant (PDA), cellular phone, network appliance, server, network router, switch, or bridge, or any machine capable of executing (sequentially or otherwise) a set of instructions specifying actions to be taken by the machine. Furthermore, although a single machine is described, the term "machine" should also be understood to include any set of machines that individually or collectively execute one or more sets of instructions to perform any one or more of the methods discussed herein.
[0064] Example computer system 661 includes processing unit 660 (e.g., with...) Figure 4 The associated processing device 460, main memory 604 (e.g., ROM, flash memory, DRAM, such as synchronous DRAM (SDRAM) or Rambus DRAM (RDRAM)), static memory 606 (e.g., flash memory, static random access memory (SRAM)), and data storage system 618 communicate with each other via bus 630.
[0065] Processing device 660 represents one or more general-purpose processing devices, such as microprocessors, central processing units, etc. More specifically, the processing device may be a Complex Instruction Set Computing (CISC) microprocessor, a Reduced Instruction Set Computing (RISC) microprocessor, a Very Long Instruction Word (VLIW) microprocessor, or a processor implementing other instruction sets, or a combination of instruction sets. Processing device 660 may also be one or more special-purpose processing devices, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), network processors, etc. Processing device 660 is configured to execute instructions 626 to perform the operations and steps discussed herein. Computer system 661 may additionally include a network interface device 608 for communication on network 611.
[0066] Data storage system 618 may include machine-readable storage medium 624 (also referred to herein as computer-readable medium) on which one or more instruction sets 626 or software embodying any one or more of the methods or functions described herein are stored. Instructions 626 may also reside wholly or at least partially within main memory 604 and / or processing device 660 during execution by computer system 661, main memory 604 (e.g., persistent memory device 130 and / or non-persistent memory device 140), and processing device 660, which also constitutes machine-readable storage medium. Machine-readable storage medium 624, data storage system 618, and / or main memory 604 may correspond to memory subsystem 110.
[0067] In some embodiments, instruction 626 may include instructions that implement functionality corresponding to a database persistence component (e.g., data persistence component 113). For example, instruction 626 may include instructions that store the database's primary dictionary (e.g., with...) Figure 3 The associated description of the primary dictionary 351 maintains it on a non-persistent storage device (e.g., main memory 604) and the secondary dictionary of the database (e.g., secondary dictionary 353) maintains it on a persistent storage device (e.g., data storage system 618). Instruction 626 may include instructions to retrieve values from the database only from the primary dictionary. Instruction 626 may include instructions that simultaneously reflect updates to both the primary dictionary maintained on the non-persistent storage device and the secondary dictionary maintained on the persistent storage device. Instruction 626 may include instructions to maintain the values of the database in a first number of hash tables of the primary dictionary and a second number of hash tables of the secondary dictionary. Instruction 626 may include instructions to maintain the secondary dictionary as a mirror image of the primary dictionary. Instruction 626 may include instructions to maintain the values of the database in the primary dictionary based on the corresponding data temperature of the values and to maintain all values of the database in the secondary dictionary regardless of the data temperature of all values. Instruction 626 may include instructions to remove values from the database from the primary dictionary in response to a data temperature of a value falling below a threshold data temperature.
[0068] Although machine-readable storage medium 624 is shown as a single medium in the exemplary embodiment, the term "machine-readable storage medium" should be considered to include a single medium or multiple media storing one or more sets of instructions. The term "machine-readable storage medium" should also be considered to include any medium capable of storing or encoding a set of instructions executable by a machine and causing the machine to perform any one or more of the methods of this disclosure. The term "machine-readable storage medium" should therefore be considered to include, but is not limited to, solid-state memory, optical media, and magnetic media.
[0069] Some parts of the previously described algorithms and symbolic representations of operations on data bits within computer memory have been presented. These algorithmic descriptions and representations are the means by which those skilled in the art of data processing most effectively communicate the essence of their work to others skilled in the art. In this document, and generally in general, an algorithm is conceived as a self-consistent sequence of operations that produce a desired result. An operation is an operation that requires physical manipulation of a physical quantity. Typically (but not always), these quantities take the form of electrical or magnetic signals that can be stored, combined, compared, and otherwise manipulated. It has been shown that it is sometimes convenient to refer to these signals as bits, values, elements, symbols, characters, items, numbers, etc., primarily for common use.
[0070] However, it should be remembered that all these and similar terms will be associated with appropriate physical quantities and are merely convenient notations for application to those quantities. This disclosure can refer to the actions and processes of a computer system or similar electronic computing device that manipulate and transform data represented as physical (electronic) quantities in the registers and memories of a computer system into other data similarly represented as physical quantities in the computer system's memory or registers or other such information storage systems.
[0071] This disclosure also relates to apparatus for performing the operations described herein. Such apparatus may be specifically constructed for the desired purpose, or may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer. Such computer programs may be stored in computer-readable storage media, such as, but not limited to, any type of disk (including floppy disks, optical disks, CD-ROMs, and magneto-optical disks), read-only memory (ROM), random access memory (RAM), EPROM, EEPROM, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, each coupled to a computer system bus.
[0072] The algorithms and displays presented herein are not inherently related to any particular computer or other device. Various general-purpose systems can be used with the programs taught herein, or it may prove convenient to construct more specialized devices to perform the methods described herein. The structures of various such systems will be presented as illustrated in the description below. Furthermore, this disclosure is described without reference to any particular programming language. It should be understood that the teachings of this disclosure as described herein can be implemented using various programming languages.
[0073] This disclosure may be provided as a computer program product or software, which may include a machine-readable medium having instructions stored thereon for programming a computer system (or other electronic device) to perform processes according to this disclosure. Machine-readable media includes any means for storing information in a machine-readable (e.g., computer-readable) form. In some embodiments, machine-readable (e.g., computer-readable) media includes machine-readable storage media such as read-only memory (“ROM”), random access memory (“RAM”), disk storage media, optical storage media, flash memory devices, etc.
[0074] In the foregoing description, embodiments of this disclosure have been described with reference to specific example embodiments thereof. It will be apparent that various modifications may be made to this disclosure without departing from the broader spirit and scope of the embodiments set forth in the appended claims. Therefore, the description and drawings should be viewed in an illustrative rather than restrictive sense.
Claims
1. A method for database persistence, comprising: updating, in response to (571) a set command associated with a key-value store (350), simultaneously: the key-value store maintained on a non-persistent memory device (140, 240, 440) of a memory sub-system (110, 210, 410); and a mirror of the key-value store maintained on a persistent memory device (130, 230, 430) of the memory sub-system; and retrieving, in response to (573) a get command associated with the key-value store, a value of a key from the key-value store maintained on the non-persistent memory device and not providing the get command to the non-persistent memory device.
2. The method of claim 1, wherein retrieving comprises retrieving the value of the key only from the key-value store (350) maintained on the non-persistent memory device (140, 240, 440).
3. The method of claim 1, further comprising: updating, in response to updating the mirror of the key-value store maintained on the persistent memory device, a copy of the mirror of the key-value store value maintained on a solid state drive (SSD) coupled to the persistent memory device.
4. The method of claim 1, further comprising loading the key-value store (350) onto the non-persistent memory device (140, 240, 440) using the mirror of the key-value store maintained on the persistent memory device (130, 230, 430).
5. The method of claim 1, further comprising recovering the key-value store by loading the key-value store from the mirror of the database stored on the persistent memory device onto the non-persistent memory device.
6. An apparatus for database persistence, comprising: a non-persistent memory device (140, 240, 440) configured to store read and write versions of a database; wherein the non-persistent memory device is configured to receive signaling indicative of a get command associated with the database; and a persistent memory device (130, 230, 430) configured to store, simultaneously with the read and write versions of the database stored on the non-persistent memory device, a write-only version as a mirror of the database; wherein the persistent memory device is configured to not receive the signaling indicative of the get command.
7. The apparatus of claim 6, wherein the non-persistent memory device comprises random access memory (RAM).
8. The apparatus of claim 6, wherein the database comprises a key-value store (350).
9. The apparatus of claim 6, wherein the non-persistent memory device (140, 240, 440) and the persistent memory device (130, 230, 430) are configured to simultaneously receive signaling indicative of a set command associated with the database.
10. The apparatus of claim 6, further comprising another persistent memory device (248) coupled to the persistent memory device (230) and comprising a type of persistent memory different from the persistent memory device, wherein the other persistent memory device is configured to store a copy of the write-only version of the database concurrently with the write-only version of the database stored on the persistent memory device.
11. The apparatus of claim 6, wherein the non-persistent memory device and the persistent memory device are configured to load the database from the mirror of the database stored on the persistent memory device onto the non-persistent memory device.
12. A system for database persistence, comprising: a host system (120, 220, 420) comprising a processing device (460, 660); and a memory subsystem (110, 210, 410) comprising: a non-persistent memory device (140, 240, 440) coupled to the host system and configured to store a key-value store (350); and a persistent memory device (130, 230, 430) coupled to the host system and configured to store a mirror of the key-value store, wherein the host system is configured to: in response to a get command from the processing device, cause a request for a value of a key of the key-value store to be provided to the non-persistent memory device; in response to the get command, cause a request for a value of a key of the key-value store not to be provided to the non-persistent memory device; and in response to a set command from the processing device, cause an update to the key-value store to be provided to the non-persistent memory device and the persistent memory device concurrently.
13. The system of claim 12, wherein the host system (120, 220) is further configured to: associate a request for a value of a key of the key-value store (350) with a respective first address within an address range of the non-persistent memory device (140, 240, 440); and associate an update to the key-value store with a respective second address within the address range of the non-persistent memory device and a respective third address within an address range of the persistent memory device (130, 230, 430).
14. The system of claim 13, wherein the host system (420) further comprises a crossbar switch (461) coupled to the processing device (460), the non-persistent memory device (440), and the persistent memory device (430), wherein the crossbar switch is configured to: route the request for a value of a key of the key-value store to only the non-persistent memory device based at least in part on the respective first address; route the update to the key-value store to the non-persistent memory device based at least in part on the respective second address; and and The update to the key-value store is routed to the persistent memory device based at least in part on the respective third address.
15. The system of claim 14, wherein the crossbar switch comprises software executed by the host system.
16. The system of claim 14, wherein the crossbar switch is further configured to map bytes corresponding to values of keys of the key-value store to addresses of the non-persistent memory device or the persistent memory device.
17. The system of claim 14, further comprising another persistent memory device coupled to the persistent memory device (430) and the crossbar switch (461), wherein the another persistent memory device is configured to store a copy of the mirror of the key-value store concurrently with the mirror of the key-value store stored on the persistent memory device, and wherein the crossbar switch is configured to: address the persistent memory device at a byte level, and address the another persistent memory device at a page level.
18. The system of claim 12, wherein the non-persistent memory device and the persistent memory device are configured to load the key-value store onto the non-persistent memory device from the mirror of the key-value store stored on the persistent memory device.
19. A non-transitory medium storing instructions for database persistence, the instructions executable by a processing device to: maintain a primary dictionary (351) of a database (350) on a non-persistent memory device (140, 240, 440); maintain a secondary dictionary (353) of the database on a persistent memory device (130, 230, 430) as a mirror of the primary dictionary; request values of the database only from the primary dictionary on the non-persistent memory device without requesting the values from the secondary dictionary on the persistent memory device; and concurrently reflect updates to the database in both the primary dictionary maintained on the non-persistent memory device and the secondary dictionary maintained on the persistent memory device.
20. The medium of claim 19, further storing instructions executable to maintain values of the database (350) in a first number of hash tables (352-0, 352-1) of the primary dictionary (351) and a second number of hash tables (354-0) of the secondary dictionary (353).
21. The medium of claim 19, further storing instructions executable to: maintain values of the database (350) in the primary dictionary (351) based at least in part on respective data temperatures of the values; and maintain all values of the database in the secondary dictionary (353) without regard to data temperatures of all the values.
22. The medium of claim 21, further storing instructions to remove values of the database (350) from the primary dictionary (351) responsive to data temperatures of the values being below a threshold data temperature.
23. The medium of claim 19, further storing instructions to recover the database by loading the database from the mirror of the database stored on the persistent storage device onto the non-persistent storage device.