将文件保存在 SQL Server 数据库中
我已经阅读了我可以在本网站(和其他网站)上找到的有关该主题的每个问题和答案,但仍然找不到以下场景的答案。
我有一个托管在数据中心的 SQL Server 2008R2。我的客户正在使用我的 Windows 应用程序,该应用程序将数据存储在 SQL Server 2008R2 数据库中。有Word、Excel、PDF、JPG、PNG 等文档链接到数据库中的记录。我的客户需要从任何地方访问这些文档。
我的想法是,我将把文档保存到数据库记录中,从而使它们可以从任何地方访问。
我的问题是:
- 如果托管提供商未在 SQL Server 上打开 FileStream,那么我就无法在自己的数据库上使用该设施,我的假设是否正确? (这似乎是一个合理的假设,但也许有人可以确认这在单个数据库级别上不可用。)
如果我决定,托管提供商也必须允许读/写文件夹结构,我的假设是否正确将文件直接保存到磁盘?
最后,任何人都可以评论一下他们在“云托管”SQL Server 数据库中保存文档的实际体验。性能是一个需要克服的技术问题还是只是考验用户耐心的问题之一?
感谢您的帮助和见解。
I've read every question and answer on this topic I can find on this site (and others) and still cannot find answers for the following scenario.
I have a SQL Server 2008R2 hosted in a data center. My client is using my Windows application that stores data in a SQL Server 2008R2 database. There are Word, Excel, PDF, JPG, PNG, etc documents that are linked to records in the database. My client needs to have access to these docs from anywhere.
My thinking is that I will save the docs into the database records, thus making them available from anywhere.
My questions are:
Am I correct in assuming that if the hosting provider has not turned on FileStream on SQL Server, then I cannot use that facility on my own databases? (This seems like a reasonable assumption but maybe someone can confirm this is not available on an individual database level.)
Am I correct in assuming that the hosting provider will also have to allow read/write to a folder structure if I decide to save files directly to disk?
Finally, can anyone provide comment on their real-life experiences with saving documents in a "cloud-hosted" SQL Server database. Is performance going to be a technical issue to overcome or simply one of trying users' patience?
Thanks for you help and insights.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,你错了。否则,您仍然可以将文件传入/传出数据库,只是无法使用由数据库本身提供的直接类似文件的 URL。
是的。不过,几乎所有人都这样做。
如果做得合理,除了最极端的性能关键情况之外,它没有理由不能很好地工作。这与说你应该这样做不是一回事。
No, you are not correct. You can still stream files in/out of the database otherwise, just without the ability to use direct file-like URLs which are served by the database itself.
Yes. Almost all do, though.
Done reasonably, there's no reason it can't work just fine for all but the most extreme performance-critical situations. which is not the same thing as saying that's how you should do it.