存储图像:MongoDb与文件系统 [英] Storing Images: MongoDb vs File System
问题描述
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屋!