存储图像在数据库或硬盘驱动器上 [英] storing images in database or on hard drive

查看:130
本文介绍了存储图像在数据库或硬盘驱动器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个ASP.NET Web应用程序,本网站托管在具有大的硬盘驱动器(30 GB)一个VDS(虚拟专用服务器)。用户可以上传图片和当前图像存储在数据库中的图像列(SQL服务器2008)。它是更好地存储图像的硬盘驱动器上的文件,而不是保存他们的数据库?什么是每种方法的利弊?我认为会有每一天,所以我想数据库将快速增长,最终我将有一个非常大的MDF文件!约100图片

I'm working on an ASP.NET web app, this web site is hosted on a VDS (virtual dedicated server) which has a big hard drive (30 GB). Users can upload pictures and currently images are stored in database image columns (SQL server 2008). Is it better to store images as files on hard drive instead of saving them in database? what are pros and cons of each method? I think there would be about 100 pictures each day so I suppose database will grow quickly and finally I'll have a really big MDF file!

推荐答案

这取决于你的优先权。没有毯子答案哪种方法是最好的。但是,除非你预见到需要利用这些图像数据库备份,存储指向该文件系统应该足够了。否则,文件流选项最适合存储在数据库中的图像。

It depends on your priorities. There is no blanket answer for which method is the best. However, unless you foresee the need to utilize database backups for these images, storing pointers to the file-system should be adequate. Otherwise, the filestream option is best for storing images in a database.

PinalDave就这个问题写了,你可能会发现有趣的讨论:
<一href=\"http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/\" rel=\"nofollow\">http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/

PinalDave wrote on this subject and you may find the discussion interesting: http://blog.sqlauthority.com/2009/07/13/sql-server-blob-pointer-to-image-image-in-database-filestream-storage/

这篇关于存储图像在数据库或硬盘驱动器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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