RDBMS与用于文件存储的文件系统 [英] RDBMS vs file system for file storage

查看:109
本文介绍了RDBMS与用于文件存储的文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在RDBMS中存储整个文件比在RDBMS中引用文件路径将文件存储在文件系统中有什么优势吗?

Are there any advantages of storing entire files in an RDBMS over storing the files in the file system with references to the file path in the RDBMS?

哪种方法会更快?我什么时候选择一个?使用哪个文件系统有关系吗? (例如ext3)

Which approach shall be faster? When do I choose one over the other? Does it matter which file system is in use? (say ext3)

我不希望文件有任何更改.这些文件可能是json或xml,也可能是pdf(可能性较小).另外,可能不需要经常引用这些文件.它们仅用于存档.

I do not expect the files to change at all. The files may be json or xml or might be pdf (less likely). Also, there might be no need to refer to these files often. They are only meant for archival.

谢谢.

推荐答案

鉴于不希望更改文件,将文件保留在DBMS中的价值有限.将文件保留在DBMS中的主要优点是DBMS知道如何管理事务,但是如果文件不会更改,则该优点将变得微不足道.

Given that the files are not expected to change, there is limited value in keeping the files in the DBMS. The primary advantage of keeping files in the DBMS is that the DBMS knows how to manage transactions, but if the files won't change, then that advantage becomes minuscule.

在DBMS中存储文件的另一个优点是数据库备份将包含这些文件;如果文件分别存储,则必须备份文件的单独存储空间以及DBMS本身,以确保所有数据的安全.

Another advantage of storing files in the DBMS is that the database backup will contain the files; with the files stored separately, you have to backup the separate stash of files as well as the DBMS itself to keep all the data secure.

在DBMS中存储文件的另一个优点是,数据库可以对文件的访问实施更细微的控制.

Another advantage of storing files in the DBMS is that the database can enforce more subtle controls on access to the files.

将文件存储在文件系统中的主要优点是很容易(更容易)查看所拥有的内容.

The primary advantage of storing the files in the file system is that it is easy (easier) to see what you've got.

第二个优点是您可以在DBMS外部备份或操作文件-尽管从某些角度来看这也是一个缺点.

A secondary advantage is that you can back up or manipulate the files outside the DBMS - though that is also a disadvantage from some points of view.

如果文件存储在DBMS的blob中,则普通的SQL客户端软件可以通过普通的SQL连接检索内容.如果SQL客户端软件与DBMS和文件不在同一台计算机上,则您必须担心客户端如何获取文件数据.

If the files are stored in blobs in the DBMS, then the normal SQL client software can retrieve the contents over a normal SQL connection. If the SQL client software is not on the same machine as the DBMS and the files, then you have to worry about how clients do get hold of the file data.

将文件与DBMS分开的另一个优点是可以将文件存储在DBMS计算机之外.另一方面,这会使将文件装入DBMS"的过程变得复杂.

Another advantage of separating the files from the DBMS is that the files could be stored off the DBMS machine. On the other hand, that then complicates getting the files loaded 'into the DBMS'.

总的来说,鉴于上述问题,采用"DBMS中的文件"方法似乎具有一些优势.另一方面,许多人的确采用文件系统中的文件"方法,并且他们幸免于难.可能是他们的SQL客户端与DBMS在同一台计算机上,因此文件传输问题不是无法克服的,但这是我最担心的问题.

On the whole, given the issues outlined above, there seem to be some advantages with going with the 'files in DBMS' approach. On the other hand, many people do go with 'files in file system' approach, and they survive. It may be that their SQL clients are on the same machine as the DBMS, so the file transfer issues are not insurmountable, but that's the bit that has me most worried.

这篇关于RDBMS与用于文件存储的文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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