<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

    關注

    壓力測試

    算法

    最新隨筆

    搜索

    •  

    積分與排名

    • 積分 - 96772
    • 排名 - 600

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 很黄很黄的网站免费的| 免费91麻豆精品国产自产在线观看| 67pao强力打造高清免费| 国产精品亚洲A∨天堂不卡| xxxxx做受大片在线观看免费| 无码专区一va亚洲v专区在线 | 99久在线国内在线播放免费观看| 亚洲一区二区三区偷拍女厕| 最近免费中文字幕中文高清 | 福利免费在线观看| 久久精品国产亚洲网站| 亚欧免费无码aⅴ在线观看| 亚洲韩国在线一卡二卡| 久久午夜免费视频| 亚洲va中文字幕| 亚洲高清偷拍一区二区三区| 国产成人无码精品久久久免费| 中文字幕人成人乱码亚洲电影| 久操视频免费观看| 亚洲乱码卡三乱码新区| 免费人成在线观看播放国产| 男女一边桶一边摸一边脱视频免费| 亚洲AV永久纯肉无码精品动漫| 99久久免费精品视频| 亚洲天堂2017无码中文| 免费一级毛片在级播放| 日韩av无码免费播放| 亚洲免费电影网站| 亚洲国产成人精品女人久久久| 免费无码黄网站在线看| 亚洲国产成人精品激情| 亚洲午夜精品第一区二区8050| 久久这里只精品热免费99| 国产午夜亚洲精品| 国产AⅤ无码专区亚洲AV | 在线观看视频免费国语| www.av在线免费观看| 亚洲综合色一区二区三区小说| 国产成人涩涩涩视频在线观看免费 | 麻豆亚洲AV成人无码久久精品 | 亚洲伊人成无码综合网|