存储二进制或图像文件的最佳方式 [英] Best way storing binary or image files

查看:29
本文介绍了存储二进制或图像文件的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

存储二进制图像文件的最佳方式是什么?

What is the best way storing binary or image files?

  1. 数据库系统
  2. 文件系统

解释一下,为什么?

推荐答案

没有真正最好的方法,只有一堆取舍.

There is no real best way, just a bunch of trade offs.

数据库专家:
1. 在集群环境中更容易处理.
2. 不依赖文件服务器等额外资源.
3. 负载均衡环境下无需设置同步"操作.
4. 备份自动包含文件.

Database Pros:
1. Much easier to deal with in a clustering environment.
2. No reliance on additional resources like a file server.
3. No need to set up "sync" operations in load balanced environment.
4. Backups automatically include the files.

数据库缺点:
1. 数据库的大小/增长.
2. 根据数据库服务器和您的语言,可能难以放入和检索.
3. 速度/性能.
4. 根据数据库服务器,上传和导出时需要对文件进行病毒扫描.

Database Cons:
1. Size / Growth of the database.
2. Depending on DB Server and your language, it might be difficult to put in and retrieve.
3. Speed / Performance.
4. Depending on DB server, you have to virus scan the files at the time of upload and export.

文件专家:
1. 对于单 Web/单 db 服务器安装,速度很快.
2. 很好理解的文件操作能力.换句话说,如果您的磁盘空间不足,您可以轻松地将文件移动到其他位置.
3.可以在文件静止"时进行病毒扫描.这使您可以利用扫描仪更新.

File Pros:
1. For single web/single db server installations, it's fast.
2. Well understood ability to manipulate files. In other words, it's easy to move the files to a different location if you run out of disk space.
3. Can virus scan when the files are "at rest". This allows you to take advantage of scanner updates.

文件缺点:
1. 在多网络服务器环境中,需要一个可访问的共享.也应将其集群以进行故障转移.
2. 处理文件访问的附加安全要求.您必须小心网络服务器和/或共享不允许文件执行.
3. 事务备份必须考虑文件系统.

File Cons:
1. In multi web server environments, requires an accessible share. Which should also be clustered for failover.
2. Additional security requirements to handle file access. You have to be careful that the web server and/or share does not allow file execution.
3. Transactional Backups have to take the file system into account.

上面说过,SQL 2008 有一个叫做 FILESTREAM 的东西,它结合了两个世界.您上传到数据库,它会透明地将文件存储在磁盘上的目录中.检索时,您可以从数据库中提取;或者您可以直接转到它在文件系统上的位置.

The above said, SQL 2008 has a thing called FILESTREAM which combines both worlds. You upload to the database and it transparently stores the files in a directory on disk. When retrieving you can either pull from the database; or you can go direct to where it lives on the file system.

这篇关于存储二进制或图像文件的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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