你会将二进制数据存储在数据库或文件系统中吗? [英] Would you store binary data in database or in file system?

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

问题描述

这是先前已提出的问题( large-text-and-images -in-sql ),但主要用于将要更改的数据。在我的情况下,数据将被存储,从不改变。似乎保持一切一切似乎明智。

This is a question which has been asked before (large-text-and-images-in-sql) but mainly for data which will be changed. In my case the data will be stored and never changed. Just seems sensible to keep everything together.

有什么我不应该将静态二进制数据存储在数据库中的原因吗?

Are there any reasons why I should not store static binary data in a database?

假设它是一个明智的事情,有没有任何优势,将这些数据存储在单独的表中? (你现在可能开始意识到我不是数据库专家...)

Assuming it is a sensible thing to do, are there any advantages to storing such data in separate tables? (You might begin to realise now that I'm not a DB expert...)

澄清:
可能不会超过10-20用户,但这些将在美国和英国。

Clarify: There will probably be no more than 10-20 users but these will be in the US and in the UK. The binary data will have to be transfered in any case.

推荐答案

将数据存储在数据库中的优势是利用数据库安全机制和减少维护成本(备份,...)。其缺点是增加了数据库负载和使用连接(对于每个连接许可的数据库服务器可能很昂贵)。如果您使用的是SQL Server 2008,请 FILESTREAM

The advantage of storing data in the DB is taking advantage of DB security mechanisms and reducing maintanence cost (backups, ...). The disadvantage of it is increasing DB load and consuming connections (which might be expensive for per-connection licensed database servers). If you are using SQL Server 2008, FILESTREAM might be a nice alternative.

顺便说一句,对于Web应用程序(或任何其他可能需要流式传输数据的应用程序),通常在DB外存储数据更加明智。

By the way, for Web apps (or any other apps that might need streaming the data), it's usually more sensible to store data outside DB.

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

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