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

    常用鏈接

    留言簿(1)

    隨筆分類(17)

    隨筆檔案(28)

    文章分類(30)

    文章檔案(30)

    相冊

    收藏夾(2)

    hibernate

    java基礎

    mysql

    xml

    關注

    壓力測試

    算法

    最新隨筆

    搜索

    •  

    積分與排名

    • 積分 - 96322
    • 排名 - 601

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 狠狠躁狠狠爱免费视频无码| 456亚洲人成在线播放网站| 无人视频在线观看免费播放影院| 日本三级2019在线观看免费| 亚洲综合在线成人一区| 99久久人妻精品免费一区| 亚洲AV日韩AV永久无码免下载 | caoporm碰最新免费公开视频| 在线观看亚洲免费视频| 亚洲AV成人一区二区三区观看| 成人av免费电影| 亚洲av综合日韩| 国产成人亚洲综合无码| 四虎国产精品免费永久在线| 亚洲AV成人无码久久精品老人| 久久久久久精品免费免费自慰| 亚洲乱人伦精品图片| 女人18毛片特级一级免费视频| 国产亚洲欧美日韩亚洲中文色 | 亚洲精品乱码久久久久久按摩| 国产一级淫片a免费播放口| 亚洲伊人tv综合网色| 中文毛片无遮挡高潮免费| 精品国产成人亚洲午夜福利| 国产大片51精品免费观看| 国产精品极品美女自在线观看免费| 亚洲AV无码国产精品色午友在线 | 亚洲AV无码乱码在线观看牲色| 好吊色永久免费视频大全| 精品无码一区二区三区亚洲桃色 | 麻豆69堂免费视频| 亚洲午夜无码久久久久| 亚洲精品视频在线观看免费| 亚洲乱码中文字幕在线| 亚洲色精品aⅴ一区区三区| 亚洲人成在线免费观看| 亚洲av无码一区二区三区天堂| 亚洲国产一二三精品无码| 五月婷婷综合免费| 一级白嫩美女毛片免费| 亚洲精品国产成人|