<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

    對于MongoDB collection下的文檔而言,在文件大于16MB時,我們應該使用GridFS。

    在一些解決方案中,使用MongoDB的GridFS存儲大文件,比使用系統級別的文件系統更便利。
    .當文件系統的目錄對文件數量有限制時,你應該使用GridFS來存儲需要的盡可能多的文件;
    .當你想讓你的文件和元數據在多個系統和設施之間自動同步和部署時。使用地理上分布的副本集(geographically distributed replica sets),MongoDB可以自動地分發文件和元數據到多個mongo實例和設施上。
    .當你想訪問大文件的部分信息,而又不想把整個文件加載到內存時,你可以使用GridFS調回部分文件,而不用把整個文件讀入到內存。

    如果你需要自動的更新文件的整個內容,不要使用GridFS.作為替代,你可以存儲文件的多個版本,并且在元數據中指定文件的當前版本。在上傳新版本的文件后,你可以以原子更新來更新表示為"latest"的元數據字段,如果需要的話,你可以刪除以前的版本。

    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 閱讀(520) 評論(0)  編輯  收藏 所屬分類: nosql
    <2013年4月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    常用鏈接

    留言簿(1)

    隨筆分類(17)

    隨筆檔案(28)

    文章分類(30)

    文章檔案(30)

    相冊

    收藏夾(2)

    hibernate

    java基礎

    mysql

    xml

    關注

    壓力測試

    算法

    最新隨筆

    搜索

    •  

    積分與排名

    • 積分 - 96774
    • 排名 - 600

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 99久久这里只精品国产免费| 日韩精品极品视频在线观看免费 | a级毛片免费在线观看| 三年片在线观看免费西瓜视频 | 最近免费中文在线视频| 情人伊人久久综合亚洲| 久久精品成人免费国产片小草| 59pao成国产成视频永久免费| 亚洲AV永久青草无码精品| 亚洲AV无码AV日韩AV网站| 国外成人免费高清激情视频| 亚洲国产精品碰碰| 一区二区三区免费电影| 国产亚洲精品线观看动态图| 国产午夜成人免费看片无遮挡| 国产亚洲综合成人91精品| 久久久久久AV无码免费网站| 亚洲精品国产情侣av在线| 国产黄在线观看免费观看不卡| 国产亚洲精品精品国产亚洲综合| 两个人日本WWW免费版| 日韩伦理片电影在线免费观看| 亚洲成AV人片一区二区密柚| 最近的2019免费中文字幕| 4444亚洲国产成人精品| 中文免费观看视频网站| 亚洲依依成人亚洲社区| **毛片免费观看久久精品| 亚洲视频在线观看2018| 免费萌白酱国产一区二区| 永久免费av无码入口国语片| 亚洲成a人片毛片在线| 日本在线看片免费| 亚洲伦理中文字幕| 亚洲毛片网址在线观看中文字幕| 亚洲日本va一区二区三区| 亚洲国产一区明星换脸| 99国产精品视频免费观看| 亚洲精品无码国产片| 久久亚洲国产精品| 性感美女视频在线观看免费精品|