存储上传的照片和文档-文件系统与数据库Blob [英] storing uploaded photos and documents - filesystem vs database blob

查看:91
本文介绍了存储上传的照片和文档-文件系统与数据库Blob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的具体情况

财产管理网站,用户可以在其中上传照片和租赁文件.对于每个公寓单元,可能会有4张照片,因此系统中不会有过多的照片.

Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system.

对于照片,每张照片都有缩略图.

For photos, there will be thumbnails of each.

我的问题

我的第一要务是性能.对于最终用户,我想加载页面并尽快显示图像.

My #1 priority is performance. For the end user, I want to load pages and show the image as fast as possible.

我应该将图像存储在数据库或文件系统中,还是没关系?我需要缓存什么吗?

Should I store the images inside the database, or file system, or doesn't matter? Do I need to be caching anything?

提前谢谢!

推荐答案

虽然所有内容都有例外,但通常情况是,将图像存储在文件系统中是您的最佳选择.您可以轻松地为图像提供缓存服务,无需担心用于处理图像的其他代码,并且可以根据需要通过标准图像编辑方法轻松地对图像进行维护.

While there are exceptions to everything, the general case is that storing images in the file system is your best bet. You can easily provide caching services to the images, you don't need to worry about additional code to handle image processing, and you can easily do maintenance on the images if needed through standard image editing methods.

听起来您的业务模式非常适合这种情况.

It sounds like your business model fits nicely into this scenario.

这篇关于存储上传的照片和文档-文件系统与数据库Blob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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