当前位置:网站首页>什么情况下应该使用GridFS?
什么情况下应该使用GridFS?
2022-06-24 08:12:00 【黄佳俊、】
对于MongoDB collection下的文档而言,在文件大于16MB时,我们应该使用GridFS。
在一些解决方案中,使用MongoDB的GridFS存储大文件,比使用系统级别的文件系统更便利。
.当文件系统的目录对文件数量有限制时,你应该使用GridFS来存储需要的尽可能多的文件;
.当你想让你的文件和元数据在多个系统和设施之间自动同步和部署时。使用地理上分布的副本集(geographically distributed replica sets),MongoDB可以自动地分发文件和元数据到多个mongo实例和设施上。
.当你想访问大文件的部分信息,而又不想把整个文件加载到内存时,你可以使用GridFS调回部分文件,而不用把整个文件读入到内存。如果你需要自动的更新文件的整个内容,不要使用GridFS.作为替代,你可以存储文件的多个版本,并且在元数据中指定文件的当前版本。在上传新版本的文件后,你可以以原子更新来更新表示为"latest"的元数据字段,如果需要的话,你可以删除以前的版本。
边栏推荐
- Webrtc series - network transmission 5: select the optimal connection switching
- [noi Simulation Competition] send (tree DP)
- 【bug】@JsonFormat 使用时出现日期少一天的问题
- 解决:jmeter5.5在win11下界面上的字特别小
- leetcode--字符串
- The border problem after the focus of input
- [noi simulation] pendulum (linear algebra, Du Jiao sieve)
- Software system dependency analysis
- ThinkPHP 5.0 模型关联详解
- 金仓KFS replicator安装(Oracle-KES)
猜你喜欢

Zero foundation self-study SQL course | sub query

Zero foundation self-study SQL course | related sub query

MySQL data (Linux Environment) scheduled backup

Target detection series fast r-cnn

普通人没有学历,自学编程可以月入过万吗?

目标检测系列——Fast R-CNN

EasyExcel单sheet页与多sheet页写出

Yolox backbone -- implementation of cspparknet

In depth analysis of Apache bookkeeper series: Part 3 - reading principle

CDGA|到底怎么才能做好数据治理呢?
随机推荐
Get post: do you really know the difference between requests??????
支持向量机(SVC,NuSVC,LinearSVC)
Zero foundation self-study SQL course | sub query
【Redis實現秒殺業務①】秒殺流程概述|基本業務實現
软件系统依赖关系分析
Dynamic saving and recovery of FPU context under risc-v architecture
荐书丨《好奇心的秘密》:一个针尖上可以站多少跳舞的小天使?
Inspiration from reading CVPR 2022 target detection paper
PHP封装一个文件上传类(支持单文件多文件上传)
Niuke network decimal integer to hexadecimal string
Weekly recommended short video: is the ultimate form of computing "meta universe"?
【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试
浮点数表示法(总结自CS61C和CMU CSAPP)
深入了解 border
十二、所有功能实现效果演示
[ES6 breakthrough] promise is comparable to native custom encapsulation (10000 words)
目标检测系列——Fast R-CNN
linux(centos7.9)安装部署mysql-cluster 7.6
Zero foundation self-study SQL course | having clause
Longest public prefix of leetcode