当前位置:网站首页>什么情况下应该使用GridFS?
什么情况下应该使用GridFS?
2022-06-24 08:12:00 【黄佳俊、】
对于MongoDB collection下的文档而言,在文件大于16MB时,我们应该使用GridFS。
在一些解决方案中,使用MongoDB的GridFS存储大文件,比使用系统级别的文件系统更便利。
.当文件系统的目录对文件数量有限制时,你应该使用GridFS来存储需要的尽可能多的文件;
.当你想让你的文件和元数据在多个系统和设施之间自动同步和部署时。使用地理上分布的副本集(geographically distributed replica sets),MongoDB可以自动地分发文件和元数据到多个mongo实例和设施上。
.当你想访问大文件的部分信息,而又不想把整个文件加载到内存时,你可以使用GridFS调回部分文件,而不用把整个文件读入到内存。如果你需要自动的更新文件的整个内容,不要使用GridFS.作为替代,你可以存储文件的多个版本,并且在元数据中指定文件的当前版本。在上传新版本的文件后,你可以以原子更新来更新表示为"latest"的元数据字段,如果需要的话,你可以删除以前的版本。
边栏推荐
- [use picgo+ Tencent cloud object to store cos as a map bed]
- 每周推荐短视频:计算的终极形态是“元宇宙”?
- Easyexcel single sheet and multi sheet writing
- Time series data augmentation for deep learning: paper reading of a survey
- Webrtc series - network transmission 5: select the optimal connection switching
- 正则匹配手机号
- Software system dependency analysis
- Applet wx show
- 牛客网 字符串变形
- CF566E-Restoring Map【bitset】
猜你喜欢

eBanb B1手环刷固件异常中断处理

4275. Dijkstra sequence

当程序员被问会不会修电脑时… | 每日趣闻

Lu Qi: I am most optimistic about these four major technology trends

Numpy numpy中的np.c_和np.r_详解

零基础自学SQL课程 | 相关子查询

The list of open source summer winners has been publicized, and the field of basic software has become a hot application this year

深入了解 border
![[e325: attention] VIM editing error](/img/58/1207dec27b3df7dde19d03e9195a53.png)
[e325: attention] VIM editing error

Leetcode -- wrong set
随机推荐
【ES6闯关】Promise堪比原生的自定义封装(万字)
支持向量机(SVC,NuSVC,LinearSVC)
Webrtc series - network transmission 5: select the optimal connection switching
linux(centos7.9)安装部署mysql-cluster 7.6
Jincang KFS replicator installation (oracle-kes)
Learn Tai Chi Maker - esp8226 (12) esp8266 multitasking
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热报名中
LeetCode之最长公共前缀
MySQL - SQL statement
2021-05-20computed and watch applications and differences
php文件锁
RISC-V架构下 FPU Context 的动态保存和恢复
Longest public prefix of leetcode
零基础自学SQL课程 | HAVING子句
[Niuke] length of the last word of HJ1 string
Some common pitfalls in getting started with jupyter:
ThinkPHP5多语言切换项目实战
Cdga | how can we do well in data governance?
Weekly recommended short video: is the ultimate form of computing "meta universe"?
【bug】@JsonFormat 使用时出现日期少一天的问题