Live data from Hacker News

How to Build a Non-Volatile Memory DBMS

cs.cmu.edu

31–37 of 37 posts

Re: How to Build a Non-Volatile Memory DBMS

#31

Eh. None of this is new, and we already anticipated this with LMDB back in 2009. The fact that NVRAM is directly addressable (and thus can bypass the page cache) will eventually play out as irrelevant. It will always be a fact that slower mass-storage will exist, more cheaply than fast in-core storage, persistent or not. The page cache will still be needed even for NVRAM, and the "page" will still be the necessary at…

"Every commodity system that has tried to do without PMMUs has failed..."

I would like to read about these. Anyone have any pointers?

Re: How to Build a Non-Volatile Memory DBMS

#32
post #29

Earlier quoted context omitted.

I'm not sure that using mmap(2) is enough. You're still writing pages, so you're writing more than you have to, so writes will not go as fast on NVM as they could. LMDB does logging since it does copy-on-write -- it just reuses free pages as soon as possible, which means that over time the log disappears. (LMDB is not an append-only DB.) I agree as to GCs. Having to GC is not just wasted work, it's a performance disa…

> I'm not sure that using mmap(2) is enough. You're still writing pages, so you're writing more than you have to, so writes will not go as fast on NVM as they could. If you're using the new fangled memory there's a few components in play. First in Linux there's DAX. DAX lets you mmap in the devices pages directly without going through the page cache. And the processor can handle this like a memory mmaped device (with…

I got that. My point is that merely using this is insufficient to make your DB go fast on NVM. As the presentation says, you need to consider changing the on-disk^W^W^Wpersistent storage format to be one that writes less (not so much because of write cycle limits, but because writes are slower, and to reduce the number of additional writes needed in, say, a COW format.

Re: How to Build a Non-Volatile Memory DBMS

#33
post #30

Earlier quoted context omitted.

Note that the LMDB approach, and especially if you want MDB_FIXEDMAP, limits DB size to the largest mmap()ing you can get at a fixed location. That's not good in a world of 48-bit address spaces.

Practically it's even less than 47 bits. :) But sure, know your limits.

Yes, I know :)

Re: How to Build a Non-Volatile Memory DBMS

#34
post #31

Eh. None of this is new, and we already anticipated this with LMDB back in 2009. The fact that NVRAM is directly addressable (and thus can bypass the page cache) will eventually play out as irrelevant. It will always be a fact that slower mass-storage will exist, more cheaply than fast in-core storage, persistent or not. The page cache will still be needed even for NVRAM, and the "page" will still be the necessary at…

"Every commodity system that has tried to do without PMMUs has failed..." I would like to read about these. Anyone have any pointers?

Yes, I am curious about this argument too. Is there any links related with this?

Re: How to Build a Non-Volatile Memory DBMS

#35

Eh. None of this is new, and we already anticipated this with LMDB back in 2009. The fact that NVRAM is directly addressable (and thus can bypass the page cache) will eventually play out as irrelevant. It will always be a fact that slower mass-storage will exist, more cheaply than fast in-core storage, persistent or not. The page cache will still be needed even for NVRAM, and the "page" will still be the necessary at…

Meta-observation: LMDB is a highly-optimized storage engine. However, it is not a full-featured DBMS (e.g., no support for query optimization). This talk focuses on the potential impact of NVM on different layers of a full-featured DBMS -- not only the storage engine.

> The fact that NVRAM is directly addressable (and thus can bypass the page cache) will eventually play out as irrelevant. It will always be a fact that slower mass-storage will exist, more cheaply than fast in-core storage, persistent or not.

Well, it depends on the latency of the NVM device. If the NVM device is directly addressable and has DRAM-like access latencies, I suspect that we must re-examine the assumptions underlying storage virtualization. Although I agree that the OS/DBMS would still need to maintain a page cache for data residing on slow block-addressable SSD/HDDs, I suspect that this will not be the case for data residing on fast byte-addressable NVM.

> Anything that requires logging or any form of compaction or garbage collection is wasted work. It's completely unnecessary, and that has nothing to do with NVM. Treating NVM DB design as if it's an entirely new and different animal is frankly ignorant. The right design works in all scenarios - as LMDB does.

If you think about it, logging is equivalent to versioning. To ensure atomicity and durability, a DBMS must maintain BEFORE and AFTER images of tuples. Unless it is a pure append-only system, the DBMS cannot refrain from reclaiming the storage space associated with OLDER tuple images. Note that these images can be stored either in the log or in multi-versioned heap storage. Maintaining a second B+tree to keep track of free pages, as is done is LMDB, is simply an implementation detail.

Re: How to Build a Non-Volatile Memory DBMS

#36
post #3

Since machines can crash, possibly corrupting data, it seems like you still need replication? The network might be the new bottleneck.

That's correct, the DBMS will rely on replication to survive media failures. The "NVM Express over Fabrics" standard is a step along that direction.

http://www.nvmexpress.org/wp-content/uploads/NVMe_Over_Fabri...

Re: How to Build a Non-Volatile Memory DBMS

#37
post #5

The presentation and the paper pretty much describe how LMDB works already. https://symas.com/lightning-memory-mapped-database/ Except, it allows only a single writer and it's not directly byte-addressable, unless you make a request to preallocate a chunk of fixed-size mmap'ed memory.

LMDB is a highly-optimized storage engine. However, it is not a full-featured DBMS (e.g., no support for query optimization). This talk focuses on the potential impact of NVM on different layers of a full-featured DBMS -- not only the storage engine.
Post reply on HN