在ASP.NET是它更好地上传的文件存储到关系数据库中,或者把它放到文件系统? [英] In ASP.NET is it better to store an uploaded file into a relational database, or put it into the file system?
问题描述
这是好到上传的文件存储到关系数据库或将其放在文件系统在IIS目录下?我以为关系系统将是一个更好的选择。任何意见?你什么时候会使用一个比其他?
Is it good to store the uploaded file into a relational database or put it in a file system under a directory in IIS? I thought relational system will be a better choice. Any comments? When will you use one over the other?
编辑:RDBMS,将使其更容易涉及多个文件附件的记录。它更容易维护的版本(S)
RDBMS, will make it easier to relate multiple file attachments to a record. It's easier to maintain version(s)
文件系统,使其更易于存储数据,我认为明智的性能,这是一个更好的选择。
File systems make it easier to store data and I think performance wise this is a better choice.
推荐答案
这要看情况。如果要存储非常大的文件,你的数据库将成为真正的大 - 考虑这个 - 它会影响您的主机的价格
It really depends on the case. If you are storing very large files your DB will become really big - consider this - it may affect the price of your hosting.
在数据库中存储的文件是preferred当你是一个Web场中 - 例如,如果你的应用程序的请求是由多个服务器处理,你存储在数据库中的文件,那么SQL集群是你所需要的和存储在这种情况下,文件系统中的文件是困难得多! - 你必须通过服务器群使用共同的位置或同步的文件
Storing files in a DB is preferred when you are in a web farm - for example if the requests to your application are processed by several servers and you store the files in a DB, then SQL clustering is all you need, and storing the files in the file system in such case is a lot harder - you have to use a common location or synchronize the files through the server farm!
我会用一个DB用于文件存储 - 一个位置为所有与您的应用程序的数据 - 更易于维护和备份/恢复!
I would use a DB for a file store - one location for all the data related to your application - easier to maintain and backup/restore!
下面是一篇文章,解释如何在数据库存储: HTTP:// WWW。 dbazine.com/sql/sql-articles/charran5
Here is an article explaining how to store in a DB: http://www.dbazine.com/sql/sql-articles/charran5
下面是关于SQL Server 2008和FILESTREAM功能一个有趣的阅读: HTTP:// WWW。 devx.com/dotnet/Article/40812
Here is an interesting reading about SQL Server 2008 and the filestream feature: http://www.devx.com/dotnet/Article/40812
这篇关于在ASP.NET是它更好地上传的文件存储到关系数据库中,或者把它放到文件系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!