FIELD

Embodiments described herein relate generally to computer systems, and more specifically, to techniques for implementing a buffer cache for a persistent file system in non-volatile memory.

BACKGROUND

Database systems are typically stored on persistent disk media. Disk I/O latency tends to be a performance bottleneck for on-disk database systems. As a result, on-disk database systems tend to be designed to minimize the effect of I/O latency. Such database systems do not address how to take advantage of non-volatile memory when the entire database fits in non-volatile memory.

A database may be implemented entirely in volatile memory, such as dynamic random-access memory (DRAM). However, because volatile memory is not persistent, it cannot guarantee durability of the data. Thus, such database systems are not suitable for running a database independently of persistent storage.

Byte-addressable non-volatile memory, such as non-volatile random-access memory (NVRAM). NVRAM is random-access memory that retains stored information, even when power is turned off. The latency for this new class of non-volatile memory is expected to be slightly slower than, but within the same order of magnitude of DRAM.

On a disk-based storage system, a buffer cache is typically used for disk buffering. In disk buffering, a buffer cache stored in DRAM is used to mediate data transfer. Accessing the buffer cache in DRAM is faster than reading from disk. Typically, when an I/O request is issued, the operating system searches the buffer cache for the requested data. If the data is in the buffer cache, the I/O request is satisfied without accessing the disk. If the data is not in the buffer cache, the data is copied from disk to the buffer cache on a block by block basis. The I/O operations are then performed on the data in the buffer cache rather than on the disk. Typically, a write operation is initially performed on copies of data blocks in the buffer cache. When the write operation is successfully performed on the data blocks in the buffer cache, the modified data blocks are copied to disk, thereby completing the write operation.

A database system that stores at least a portion of the database in DRAM (a “DRAM-enabled database system”) cannot be directly adapted to store the same data in NVRAM due to fundamental differences in the behavior of DRAM and NVRAM. For example, because DRAM-enabled database systems cannot rely on volatile memory for persistence, these database systems maintain, in persistent storage, a copy of the database, or data usable to construct a persistent copy of the database. If a process in a DRAM-enabled database system makes changes to a database stored in DRAM, the volatile memory can be left in an unpredictable state if the process crashes before the changes are complete. However, because of the persistently stored data, the DRAM-enabled database system can recover from this crash without affecting the atomicity, consistency, isolation and durability (ACID) properties of the database.

If the DRAM and the persistent storage in a DRAM-enabled database system is directly replaced with NVRAM, this scenario would cause a failure. More specifically, if the database were stored completely in NVRAM, when a process that directly operates on the database crashes before changes to the database are complete, the database would be left in an unpredictable state.

The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.

