存储图像:DB或文件系统 - [英] Storing Images : DB or File System -

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

问题描述

我在这方面读了一些文章,但我还是不明白在我的情况下什么是最好的解决方案。


我开始写一个新的web应用程序,后端将提供约 1-10百万张图片。 (单个图片的平均大小 200-500kB

I read some post in this regard but I still don't understand what's the best solution in my case.

I'm start writing a new webApp and the backend is going to provide about 1-10 million images. (average size 200-500kB for a single image)

我的网站将提供内容和图片至 100-1000用户

My site will provide content and images to 100-1000 users at the same time.

我还希望尽可能降低提供商的费用(但这是次要要求)。
我认为文件系统空间比DB大小的成本更便宜。

I'd like also to keep Provider costs as low as possible (but this is a secondary requirement). I'm thinking that File System space is less expensive if compared to the cost of DB size.

我个人喜欢把所有图像放在但是任何建议都会非常感谢:)

Personally I like the idea of having all my images in the DB but any suggestion will be really appreciated :)

你认为在我的case DB方法是正确的选择吗?

Do you think that in my case the DB approach is the right choice?

推荐答案

将所有这些图像放在你的数据库中将会非常非常大。这意味着当你的数据库引擎可以缓存热应用程序数据时,你的数据库引擎将忙于缓存所有这些图像(一个不是真正设计的任务)。

Putting all of those images in your database will make it very, very large. This means your DB engine will be busy caching all those images (a task it's not really designed for) when it could be caching hot application data instead.

保留文件缓存直到操作系统和/或你的反向代理 - 他们会更好。

Leave the file caching up to the OS and/or your reverse proxy - they'll be better at it.

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

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