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

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

问题描述

什么是最好的办法存储二进制图片文件?

What is the best way storing binary or image files?


  1. 数据库系统

  2. 文件系统

  1. Database System
  2. File System

请你的说明,为什么?

推荐答案

有没有真正的最好的办法,只是一堆权衡的。

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.根据DB服务器上,你必须病毒扫描文件在上传和出口的时间。

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 /单数据库服务器安装,速度非常快。结果
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.多的web服务器环境中,需要访问的份额。这也应该聚集故障转移。结果
2.额外的安全要求,以处理文件访问。你必须要小心,Web服务器和/或股份不允许文件执行。结果
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天全站免登陆