<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 28,  comments - 15,  trackbacks - 0

    對(duì)于MongoDB collection下的文檔而言,在文件大于16MB時(shí),我們應(yīng)該使用GridFS。

    在一些解決方案中,使用MongoDB的GridFS存儲(chǔ)大文件,比使用系統(tǒng)級(jí)別的文件系統(tǒng)更便利。
    .當(dāng)文件系統(tǒng)的目錄對(duì)文件數(shù)量有限制時(shí),你應(yīng)該使用GridFS來(lái)存儲(chǔ)需要的盡可能多的文件;
    .當(dāng)你想讓你的文件和元數(shù)據(jù)在多個(gè)系統(tǒng)和設(shè)施之間自動(dòng)同步和部署時(shí)。使用地理上分布的副本集(geographically distributed replica sets),MongoDB可以自動(dòng)地分發(fā)文件和元數(shù)據(jù)到多個(gè)mongo實(shí)例和設(shè)施上。
    .當(dāng)你想訪問(wèn)大文件的部分信息,而又不想把整個(gè)文件加載到內(nèi)存時(shí),你可以使用GridFS調(diào)回部分文件,而不用把整個(gè)文件讀入到內(nèi)存。

    如果你需要自動(dòng)的更新文件的整個(gè)內(nèi)容,不要使用GridFS.作為替代,你可以存儲(chǔ)文件的多個(gè)版本,并且在元數(shù)據(jù)中指定文件的當(dāng)前版本。在上傳新版本的文件后,你可以以原子更新來(lái)更新表示為"latest"的元數(shù)據(jù)字段,如果需要的話,你可以刪除以前的版本。

    For documents in a MongoDB collection, you should always use GridFS for storing files larger than 16 MB.

    In some situations, storing large files may be more efficient in a MongoDB database than on a system-level filesystem.

    • If your filesystem limits the number of files in a directory, you can use GridFS to store as many files as needed.
    • When you want to keep your files and metadata automatically synced and deployed across a number of systems and facilities. When usinggeographically distributed replica sets MongoDB can distribute files and their metadata automatically to a number of mongod instances and facilities.
    • When you want to access information from portions of large files without having to load whole files into memory, you can use GridFS to recall sections of files without reading the entire file into memory.

    Do not use GridFS if you need to update the content of the entire file atomically. As an alternative you can store multiple versions of each file and specify the current version of the file in the metadata. You can update the metadata field that indicates “latest” status in an atomic update after uploading the new version of the file, and later remove previous versions if needed.

    Furthermore, if your files are all smaller the 16 MB BSON Document Size limit, consider storing the file manually within a single document. You may use the BinData data type to store the binary data. See your drivers documentation for details on using BinData.

    For more information on GridFS, see GridFS.


    地址:http://docs.mongodb.org/manual/faq/developers/#faq-developers-when-to-use-gridfs

    posted on 2013-04-09 18:41 zhangxl 閱讀(508) 評(píng)論(0)  編輯  收藏 所屬分類: nosql
    <2013年4月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    常用鏈接

    留言簿(1)

    隨筆分類(17)

    隨筆檔案(28)

    文章分類(30)

    文章檔案(30)

    相冊(cè)

    收藏夾(2)

    hibernate

    java基礎(chǔ)

    mysql

    xml

    關(guān)注

    壓力測(cè)試

    算法

    最新隨筆

    搜索

    •  

    積分與排名

    • 積分 - 96260
    • 排名 - 601

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲欧美aⅴ在线资源| AV免费网址在线观看| 成人精品国产亚洲欧洲| 亚洲一区二区三区首页| 国产亚洲精aa成人网站| 成在线人永久免费视频播放| 曰批视频免费40分钟试看天天| 国产三级在线免费观看| 亚洲AV无码资源在线观看| 亚洲成a人片在线网站| 亚洲AV无码不卡在线播放| 国产专区一va亚洲v天堂| 国产在线19禁免费观看国产| 99久久这里只精品国产免费| 91人人区免费区人人| 国产一级淫片a免费播放口| 51午夜精品免费视频| 国产精品亚洲一区二区三区久久| 亚洲伊人久久大香线蕉AV| 亚洲a级片在线观看| 亚洲视频在线观看地址| 久久亚洲国产伦理| 亚洲成av人在线视| 亚洲精品午夜无码专区| 国产亚洲欧洲Aⅴ综合一区| 亚洲国产精品综合久久网络| 日本免费福利视频| 免费无码黄动漫在线观看| 最近的免费中文字幕视频| 成年人免费视频观看| 成全视频在线观看免费高清动漫视频下载 | 亚洲啪啪综合AV一区| 亚洲日韩在线中文字幕第一页| 四只虎免费永久观看| 少妇亚洲免费精品| 亚洲日本va午夜中文字幕久久| 亚洲精品456播放| 亚洲综合精品网站在线观看| 中文字幕第一页亚洲| 国产精品亚洲а∨无码播放 | 国产精品偷伦视频观看免费 |