保存文件导入数据库 [英] Save files into a database

查看:129
本文介绍了保存文件导入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件保存到我的C#Windows应用程序的数据库。应该/我可以使用什么数据库技术?

I want to save files into a database in my C# Windows application. What database technology should/could I use?

我希望能够保存文件并打开保存的文件,我的应用程序。

I want to be able to save files and open saved files with my application.

推荐答案

如果你正在处理的Microsoft SQL Server,还有由微软研究院做了一个非常有趣的性能对比:

If you're dealing with Microsoft SQL Server, there's a really interesting performance comparison done by Microsoft Research:

为BLOB或不BLOB

他们得出的结论基本上是:

Their conclusion basically is:


  • 如果您的文件大多是256 KB的大小或更少,他们的保存在数据库

  • 如果您的文件大多是1 MB或更大,将它们存储在文件系统中,只存储在数据库中他们引用(例如使用 FILESTREAM SQL Server 2008中的功能)

  • 如果您的文件大多是这两个尺寸之间,它涉及到其他因素,如更新,硬件的频率可等

  • if your files are mostly 256 KB in size or less, store them inside the database
  • if your files are mostly 1 MB or larger, store them in the file system and only store a reference to them in the database (e.g. using the FILESTREAM feature in SQL Server 2008)
  • if your files are mostly between those two sizes, it comes down to other factors, like frequency of update, hardware available and so forth

如果你曾经需要存储一个文件大于2 GB,将其存储在文件系统中是唯一的选择,真的。所以这也可能是一个决定性的因素。

And if you should ever need to store a file larger than 2 GB, storing it in the filesystem is your only choice, really. So that might also be a deciding factor.

这篇关于保存文件导入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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