3

请考虑以下几点:

我存储了大约 120 万个 TIF 文件,大小从 40 KB 到 120 KB 不等。

这些文档存储在具有 NTFS 文件系统的 Windows 服务器上。

使用以下变量存储文档:

  • 客户
  • 文件类型
  • 图像文件夹
  • 实际图像

见下文:

C:\<client_id>\<doc_type_id>\image001\1.TIF

例子

C:\1\3\image001\1.TiF

它是一个 PHP 托管系统。

这个阶段的表现是可以接受的。我想知道未来最好的策略是什么。考虑到客户和文件数量将急剧增加。

我正在考虑用Jackrabbit CMS 替换整个存储。

这会是这样吗?或者

以如下格式存储文档:

  • 顾客
  • 文件类型
  • 儒略日日期文件导入。
  • 当前用户
  • 6位唯一码

例子

C:\1\1\167\2\453257\image001\image.TIF

会一样高效吗?

请不要考虑 CMS 与文件系统的所有其他考虑因素。例如版本控制、数据备份。

谢谢。

4

3 回答 3

4

诚实地?在你达到一定尺寸之前,我认为这并不重要(而且我不能,为了我的一生,记住那个尺寸......)。问题是找到一种方法,然后坚持下去,希望它会以这样一种方式,你永远不需要再碰它。我自己的建议,没有任何证据支持它,类似于你自己的建议:

c:\<customer_id>\<document_year>\<document_month>\<document_day>\actual_file.tif

我还提出建议,根据您的服务器设置,可能值得为每个客户(取决于数据量或帐户类型)提供自己的驱动器/分区。

请记住,如果没有某种用户控制或权限系统,文件路径可能会被猜测和浏览(就好像您还不知道一样……我知道,对不起)。您提出“六位唯一代码”的要点这一事实表明您不需要通用格式的路径,但我建议通用格式(您最终选择的任何格式)将是更好的主意。

回到我的 Windows 时代,我围绕文件的主要关系对自己的目录进行排序,现在它被认为是一个“标签”(c:\documents and settings\university\year1\module21\assignment1.doc例如),这使得以后更容易找到东西。您的客户似乎有他们的目录结构 - 由您执行 - 但如果他们只需要遍历日期,则查找他们上周所做的事情会更容易,当他们获得六位数的唯一号码时记住他们上周放置的东西 -命名文件夹将会非常困难。最好。

于 2009-09-05T01:51:57.543 回答
2

Your question is very similar to this one. Is your load primarily reading your images or writing? If it's read scalability you need, the post describes memcached, which is probably all you need. jackrabbit has loads more features, but is more for hierarchical text storage. Not sure it will do any better performance wise on your images. Also, if you do choose jackrabbit, make sure your content hierarchy is deep enough for jackrabbit to stay efficient. Any parent with 10,000 or more children is going to have sub-par performance.

于 2009-09-08T21:43:34.663 回答
1

The strategy for storage you proposed would need to be addressed if you intend to move your content to different machines (SAN/NAS). To do this, you would need to strip all the customer data from the path, and just create a hash that you then save in the database to link to the file you are accessing. This way you are left with a folder structure something like this:

NAS1/00/01/86/63/54/89/image01/image.tiff
NAS2/00/02/46/62/22/11/image02/image.tiff
...

I would also recommend you take a gander at MogileFS. All you need to do to speed it up is to add some sort of a proxy in front of it and all should be well.

And like Dave mentioned, make sure you don't have too many children in one folder. Things tend to get quite sluggish around 10.000.

于 2009-09-08T23:25:48.373 回答