存储图像:MongoDb与文件系统 [英] Storing Images: MongoDb vs File System

查看:455
本文介绍了存储图像:MongoDb与文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要存储大量的图像(每天大约有10,000张图像),每张图像的平均大小为1到10 MB。

I可以使用GridFS库将这些图像存储在MongoDB中,或者将Base64转换存储为一个字符串。

我的问题是,MongoDB适合这样一个有效载荷还是最好使用一个文件系统?



非常感谢,

解决方案

MongoDB GridFS与普通的文件系统相比有很多优点,它可以很好的处理你描述的数据量,因为你可以用一个分片的mongo集群进行扩展。我自己并没有在那里保存太多的二进制数据,但我不认为二进制数据和文本之间有真正的区别。所以:是的,它适合于有效载荷。


I need to store a large number of images (from around 10,000 images per day) With an average size of around 1 to 10 MB for each image.

I can store these images in MongoDB using the GridFS Library or by just storing the Base64 conversion as a string.

My question is that, is MongoDB suitable for such a payload or is it better to use a file system?

Many Thanks,

解决方案

MongoDB GridFS has a lot of advantages over a normal file system and it is definitely able to cope with the amount of data you are describing as you can scale out with a sharded mongo cluster. I have not saved that much binary data in it on my own but I do not think there is a real difference between the binary data and text. So: yes, it is suitable for the payload.

这篇关于存储图像:MongoDb与文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆