如何将MongoDB数据库中的数据存储在磁盘上? [英] How is the data in a MongoDB database stored on disk?

查看:675
本文介绍了如何将MongoDB数据库中的数据存储在磁盘上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 MongoDB 接受并检索记录为 JSON / BSON对象,但它实际上如何存储这些文件在磁盘上?它们是作为单独的 *。json 文件的集合还是作为一个大文件存储?因为 MongoDB docs声明它在使用 ext4 / xfs 的系统上工作得最好, ,这在处理大文件更好。任何人都可以确认?

I know that MongoDB accepts and retrieves records as JSON/BSON objects, but how does it actually store these files on disk? Are they stored as a collection of individual *.json files or as one large file? I have a hunch as to the latter, since the MongoDB docs state that it works best on systems with ext4/xfs, which are better at handling large files. Can anyone confirm?

推荐答案

给定的mongo数据库在磁盘上分成一系列BSON文件, 2GB。

A given mongo database is broken up into a series of BSON files on disk, with increasing size up to 2GB. BSON is its own format, built specifically for MongoDB.

这些幻灯片应该回答您的所有问题:

These slides should answer all of your questions:

http://www.slideshare.net/mdirolf / inside-mongodb-the-internals-of-an-opensource-database

这篇关于如何将MongoDB数据库中的数据存储在磁盘上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆