3 ms·
Made me think about LMMD (https://en.m.wikipedia.org/wiki/Lightning_Memory-Mapped_Database https://en.m.wikipedia.org/wiki/Lightning_Memory-Mapped_Data...) and
by jFriedensreich 6y ago
Made me think about LMMD (https://en.m.wikipedia.org/wiki/Lightning_Memory-Mapped_Database https://en.m.wikipedia.org/wiki/Lightning_Memory-Mapped_Data...) and wonder why mmap didn't seem to have catched on more in storage engines
- ricardo81 6y ago*LMDB I use it a bit. The transactional aspect of it requires a bit consideration but generally the performance is good. I'd originally used libJudy in a bunch of places for fast lookups but the init time for programs was being slowed by having to preload everything. Using an mmap/LMDB is a decent middle ground.
- jandrewrogers 6y agoFor storage engines that prioritize performance and scalability, mmap() is a poor choice. Not only is it slower and less scalable than alternatives but it also has many more edge cases and behaviors you have to consider. Compared to a good O_DIRECT/io_submit storage engine design, which is a common alternative, it isn't particularly close. And now we have io_uring as an alternative too. If your use case is quick-and-dirty happy path code then mmap() works fine. In more complex and rigorous environments, like database engines, mmap() is not well-behaved.