数据文件是否应该与数据库存储在同一台计算机(服务器)上?

发布于 2024-11-09 15:38:46 字数 201 浏览 0 评论 0原文

目前,在我们的研究小组中,我们有许多“数据文件”存储在三台服务器和几台运行不同操作系统的个人计算机上。

我们想要建立一个数据库,除了这些各种“数据文件”的 URL 之外,它还可以存储一些信息。我的问题是,我们是否必须复制所有数据文件并将它们放在数据库所在的同一服务器的目录中?或者可以将它们保留在不同计算机上吗?如果第二种情况可以的话,“数据文件”的 url 格式是什么?

Currently in our research group, we have many "data files" stored on three servers and a couple of personal computers running different operating systems.

We want to build a database, which would store some information in addition to the URLs of those various "data files". My question is, do we have to copy all the data files and put them in a directory in the same server the database is in? Or can they be left as they are on the different computers? If the second case is ok, what would be the format of the url of the "data files"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

望她远 2024-11-16 15:38:46

这实际上取决于您的预期目标以及当前的设置

  • 如果文件当前位于网络上的某个位置,并且您需要应用程序可以用来访问它们的路径,则只需存储数据库中的网络路径(\\server\share\file 对于 Windows 环境),然后读取它并访问该路径以访问文件。您需要确保每个人都具有对它们的读取访问权限。

  • 如果当前可以通过内部或外部网站 URL 访问这些文件,那么您只需存储该 URL(或其某些部分)即可 (http://mywebsite.com/myfilehttp://servername/myfile)并访问该文件。

  • 如果上述任何一个当前不成立,但您希望它们成立,那么您需要设置一个新的共享/网络服务器并将文件放在那里。不要求这与数据库在同一台服务器上,但如果是的话,它会带来更好的备份。

  • 如果您希望文件本身位于数据库中,您应该查看 Bob Fanger 的链接。

It really depends on what your intended goal is and what your current setup is like

  • If the files are currently sitting somewhere on the network, and you need a path that the application can use to access them, you just need to store the network path (\\server\share\file for Windows environments) in the database, then read it and access that path to access the files. You'll need to make sure everyone has read access to them.

  • If the files are currently accessible through a website URL, internal or external, then again, you just need to store that URL (or some portion thereof) (http://mywebsite.com/myfile or http://servername/myfile) and access that.

  • If either of the above are not currently true, but you want them to be, then you'll need to set up a new share/webserver and put the files there. There's no requirement that this be the same server as the database, but it'd make for better backups if it was.

  • If you want the files themselves to be in the database, you should check out Bob Fanger's link.

把时间冻结 2024-11-16 15:38:46

不确定你在这里问什么,但是......

如果你希望你的数据库引擎读取充满数据的文件,它们存储在哪里可能并不重要 - 尽管这可能取决于你正在使用的数据库。你使用 MySQL 吗? MS-SQL 服务器?甲骨文?

许多数据库供应商提供相对易于使用的管理工具,可以让您选择要加载的文件,并且通常文件选择器对话框可以让您浏览网络,以便可以通过网络加载文件。有关如何执行此操作的详细信息各不相同,因此请参阅数据库引擎手册以从预先存在的文件加载数据。

请注意,如果数据库位于计算机 A 上,并且通过网络从计算机 B 加载数据,则速度可能会比数据与数据库位于同一计算机上时慢。

Not sure what you're asking here but...

If you want your database engine to read files filled with data, it probably doesn't matter where they are stored - though this may depend on the database you are using. Are you using MySQL? MS-SQL Server? Oracle?

Many database vendors provide relatively easy-to-use admin tools that would let you choose a file to be loaded, and usually the file chooser dialoge lets you browse networks so you could load a file over the network. Details on how to do this vary so consult the manual for your database engine for loading data from a pre-existing file.

Be aware that if the database is on Computer A and the data is being loaded from Computer B over the network, it will probably be slower than if the data was on the same computer as the database.

↘人皮目录ツ 2024-11-16 15:38:46

无论如何,文件是否存储在数据库外部并不重要。

有关更多想法,请参阅在数据库中存储图像 - 是或否?那个。

如果文件可通过 url 访问,您可以将其与元数据一起存储,例如
http://server1/folder/file.ext,file://\server1\folder\file .ext 或“file://P:\folder\file.ext”

需要考虑的事项:

  • 备份
  • 性能
  • 元数据和数据之间的同步

It doesn't really matter if the files are stored outside the database anyway.

See Storing Images in DB - Yea or Nay? for more thoughts on that one.

If the files accessible by an url, you can store that with the meta data, like
http://server1/folder/file.ext, file://\server1\folder\file.ext or "file://P:\folder\file.ext"

Things to consider:

  • Backups
  • Performance
  • Synchronisation between the meta-data and the data
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文