简体   繁体   English

是MongoDB磁盘吗?

[英]Is MongoDB disk based?

Is all the data in MongoDB being stored on a disk in the computer system? MongoDB中的所有数据都存储在计算机系统的磁盘上吗? If a query is being run, is it straight from the disk? 如果正在运行查询,它是否直接来自磁盘? Because it is from disk, it can scale based on the disk size? 因为它来自磁盘,它可以根据磁盘大小进行扩展吗?

MongoDB does store all its data on disk so that it can persist it during server restarts. MongoDB会将其所有数据存储在磁盘上,以便在服务器重新启动时可以将其保留。 However, it is primarily liking memory. 但是,它主要是喜欢记忆。 It relies on the Operating System to schedule which bits of its database stay in memory, and which stays on disk. 它依赖于操作系统来安排其数据库的哪些位保留在内存中,哪些位保留在磁盘上。 Queries will perform better if the data is in memory of course because it's faster, but MongoDB (or rather the Operating System) will pull into memory data that's stored on disk. 如果数据在内存中当然因为速度更快,查询会表现得更好,但是MongoDB(或者更确切地说是操作系统)将会存入存储在磁盘上的内存数据。 So, in order to answer your questions: Yes, MongoDB's data is stored on disk. 所以,为了回答你的问题:是的,MongoDB的数据存储在磁盘上。 The queries are run straight from memory, backed by disk if not all the data fits in memory. 查询直接从内存运行,如果并非所有数据都适合内存,则由磁盘支持。 And it scales based on disk-size, but you will benefit from having more memory greatly. 它会根据磁盘大小进行扩展,但您可以从拥有更多内存中受益。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM