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

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

问题描述

这是之前有人问过的问题 (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?

假设这是一个明智的做法,将这些数据存储在单独的表中是否有任何优势?(您现在可能开始意识到我不是 DB 专家...)

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.

推荐答案

将数据存储在 DB 中的优势在于利用 DB 安全机制并降低维护成本(备份、...).它的缺点是增加数据库负载和消耗连接(这对于每个连接许可的数据库服务器来说可能很昂贵).如果您使用的是 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天全站免登陆