douhua1890 2011-02-22 14:14
浏览 47
已采纳

用户提交的可扩展目录结构

Our team is in the process of switching over our media library storage engine from database BLOB storage over to file system (We are using the LAMP stack, PHP is ver 5.3). Virtually all the content being stored is image data that will be pulled into the application and the most processing that will be done on it is some resizing/resampling with GD. The database storage is an artifact left over from a previous build that we are trying to abandon in order to reduce the strain on the database server.

I have built a few filesystem-based image libraries like this before, but I'd like to solidify some best practices, since this is going to get large and once it is filled with user data it will be very difficult to modify.

In my previous builds, I had created a 'resources' folder that had read/write privileges. Within that directory, there was an additional layer of directories that were named for what "section" of the site the content was pertinent to, usually organized by the name of the model or controller that implemented the stuff in there. Under that layer were user/profile ids or numerically-named folders that shared the number of whatever primary key in the database determined primary ownership (these were typically, in this kind of deployment, gallery ids of the complilation the images came from, since ownership of the gallery by a specific user could be handled through the database/object models.)

What kind of approaches has the community used in this situation, and which were most scalable? Is there any software for Apache that could handle this kind of organization more effectively than simply manually coding it into the models? I tried a few searches on SO and Google for similar threads on filesystem media storage, but didn't find much other than things to the effect of "don't use BLOBs" which we've already more or less established. Is there any hard and fast do-nots?

Thanks for your guidance!

  • 写回答

1条回答 默认 最新

  • dongmei9961 2011-02-22 14:23
    关注

    Check out MogileFS, it's a distributed parallel fault-tolerant file system.

    It provides automatic replication, namespaces, and can be integrated with nginx (i.e. no intermediate script required to serve the content). It proved to be more reliable and scalable than filesystem for storing millions of photos for our project.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大