LMDB 中的内容是否始终同时存储在磁盘和内存中?

发布于 2025-01-16 14:13:29 字数 189 浏览 3 评论 0原文

我想使用 LMDB 的 Rust 实现,但我似乎无法找到它是否始终在磁盘中和内存中保留一份副本,反之亦然。 我的理由是数据库将有一些缓存,任何溢出都会写入磁盘,但由于我在文档中找不到它,所以我不确定。

另一种情况是 LMDB 将其磁盘上的内容映射到内存,这适用于少量数据,但不适用于我想要的内容。

有谁知道 LMDB 在这方面如何运作?

I'm wanting to use the rust implementation of LMDB but I can't seem to find whether it would always maintain a copy of whats in memory also in the disk and viceversa.
My reasoning would be that the DB will have some cache and any overflows would be written to disk but since I can't find it in the documentation I'm not sure.

The other case would be that LMDB maps its contents on disk to memory and that would work for small quantities but not for what I have in mind.

Does anyone have an idea on how LMDB works on this regard?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

來不及說愛妳 2025-01-23 14:13:29

有人知道 LMDB 在这方面如何工作吗?

如果您担心无法对不适合内存的数据集进行操作,没关系 - LMDB 确实可以处理这个问题。您的数据集不限于内存大小。

LMDB 是内存映射技术,允许开发人员在磁盘上读/写数据,就像在内存中一样 - 操作系统会完成所需的所有繁重工作

LMDB 总是同时存储在磁盘和内存中?

整个数据集都在磁盘上。它的某些部分在内存中。当需要不在内存中的部分时 - 操作系统从磁盘中获取它并通过将其放入进程的内存中将其提供给应用程序

Does anyone have an idea on how LMDB works on this regard?

If you are worried about not being able to operate on a dataset that does not fit in memory, you are ok - LMDB does handle that. Your dataset is not limited to the size of ram.

LMDB is memory-mapped which is a technique that allows developers to read/write data on disk 'like' it is in memory - the OS does all the heavy lifting required

LMDB always stored BOTH in disk AND memory?

The entire dataset is on disk. Some parts of it are in memory. When the parts that are not in memory are needed - the OS fetches it from disk and gives it to the application by putting it in the process' memory

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文