专业版和在SQL Server存储文件(图片)的网站的缺点 [英] Pro & Cons of storing files(pictures) in a SQL Server for a website

查看:157
本文介绍了专业版和在SQL Server存储文件(图片)的网站的缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个Asp.Net MVC的网站。

I'm creating an Asp.Net MVC website.

我在过去,重应用,多层应用程序,使用的数据库来存储文件。

I've in the past, for heavy application, multiple layer application, used the database to store files.

但现在我质问自己,这是一个网站一个好主意?在性能视图?

But now I'm questioning myself, is this a good idea for a website? In a performance view?

它有几个优点对我说:


  • 让我可以很容易地控制如果连接的用户显示图像的权利(需要为我的项目)

  • 许可证,以确保我们有一致的数据(否则,我们可以有一个现有的文件,但在数据库中没有的信息和对

  • 我需要一个故障切换的网络服务器,这些文件将从第三个服务器需要进口,因此,如果这些文件是在数据库中,我只需要具备故障转移服务器上的工作ASP.Net网站和复制的数据库,无需同步文件。

但它也有一些缺点太多:

But it has some cons too:


  • 有一些大的文件(这是一个少数,但它会发生),如100-200MB,而我不知道它的好,有这种文件在数据库中?(它更像是一个问题;))

  • 我不知道这将有良好表现?

你觉得呢?这是合理的?我在互联网上搜索,但我没有发现某些类型的论据网站。我的问题主要是关于FILESTREAM VS FILESYSTEM,我敢肯定的FileStream比较慢,但很多?因为如果这只是一些个百分点,功能增益值得的。

What do you think? Is this reasonable? I searched on the Internet, but I didn't found some kinds of arguments for website. My question is mostly about FILESTREAM VS FILESYSTEM, I'm sure that FileStream is slower, but a lot? Because if it's only some percent, the gain of functionality worth it.

推荐答案

如果该文件是积分和系统的积极变化部分,并将它们与其它数据一起被备份 - 可将它们存储在DB内, 尝试,如果你使用SQL Server 2005+和你的文件是足够大的使用FILESTREAM领域 - 比如500K +

If the files are integral and actively changing part of the system and them have to be backed up along with the other data - you can store them inside the DB, but try to use the FILESTREAM fields if you use sql server 2005+ and your files are big enough - say 500k+

如果该文件是静态的内容,你可以在外面用DB只指针存储。这不是prevents考虑到所有的自定义权限的机器。

If the files are static content, you can store them outside with only pointers in DB. This not prevents to take into account all your custom permissions machine.

存储和处理文件里面DB通常比文件系统速度慢,但一切都取决于你的需求。

Storing and working with files inside DB is usually slower, than in filesystem, but all depends on your needs.

这篇关于专业版和在SQL Server存储文件(图片)的网站的缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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