将文件存储在数据库而不是文件系统中? [英] Storing a file in a database as opposed to the file system?

查看:175
本文介绍了将文件存储在数据库而不是文件系统中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一般来说,性能损失是如何将文件存储在数据库(特别是mssql)而不是文件系统?我不能想出一个非应用程序可移植性的原因,我想把我的文件存储为SQL Server中的varbinaries。

Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.

推荐答案

p>请查看此答案:

在DB中存储图片 - 是或否?

基本上,空间和性能影响可能相当大,用户数。另外,请记住,Web服务器很便宜,您可以轻松地添加更多以平衡负载,而数据库是最昂贵和最难以扩展Web架构的一部分。

Essentially, the space and performance hit can be quite big, depending on the number of users. Also, keep in mind that Web servers are cheap and you can easily add more to balance the load, whereas the database is the most expensive and hardest to scale part of a web architecture usually.

有一些相反的例子(例如,Microsoft Sharepoint),但通常,在数据库中存储文件不是一个好主意。

There are some opposite examples (e.g., Microsoft Sharepoint), but usually, storing files in the database is not a good idea.

应用程序和/或大致知道你将有多少用户,但对于像一个公共网站随机和不可预测的东西,你可能付出高的价格在数据库中存储文件。

Unless possibly you write desktop apps and/or know roughly how many users you will ever have, but on something as random and unexpectable like a public web site, you may pay a high price for storing files in the database.

这篇关于将文件存储在数据库而不是文件系统中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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