Web应用程序的文件存储:文件系统vs DB与NoSQL引擎 [英] File Storage for Web Applications: Filesystem vs DB vs NoSQL engines

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

问题描述

我有一个Web应用程序,存储大量的用户生成的文件。




  • 当我们移动文件夹(由我们的定义)时,应用程序),我们还必须移动磁盘上的文件(虽然这是由于原始开发人员的一些奇怪的设计决定,而不是存储在文件系统上的要求)。

  • 很难为文件系统操作编写测试;我有一个模拟文件系统类,记录像移动,删除等动作,而不执行它们,或多或少的工作,但我对测试没有100%的信心。

  • 我将添加一些其他工作,需要访问其他服务的文件,以执行其他任务(例如索引,索引,生成缩略图,电影格式转换),所以我需要远程获取文件。

  • 处理文件系统的权限有时给我们过去的问题,虽然现在我们已经转移到一个纯粹的Linux环境,这应该


  • 因此,我的主要问题是




    • 在MySQL中将文件作为BLOB存储的缺点是什么?

    • 在Cassandra之类的NoSQL系统中也存在相同的问题吗?

    • 任何人都有任何其他适当的建议,例如MogileFS等?
    • 不是直接的答案,但有一些指向非常有趣和不知何故的类似的东西。



    在MySQL中存储文件作为BLOB的缺点是什么?







    在Cassandra之类的NoSQL系统中也存在相同的问题吗?






    PS:我不想成为killjoy,但我不认为任何NoSQL解决方案将解决你的问题(NoSQL只是与大多数企业无关)。


    I have a web application that stores a lot of user generated files. Currently these are all stored on the server filesystem, which has several downsides for me.

    • When we move "folders" (as defined by our application) we also have to move the files on disk (although this is more due to strange design decisions on the part of the original developers than a requirement of storing things on the filesystem).
    • It's hard to write tests for file system actions; I have a mock filesystem class that logs actions like move, delete etc, without performing them, which more or less does the job, but I don't have 100% confidence in the tests.
    • I will be adding some other jobs which need to access the files from other service to perform additional tasks (e.g. indexing in Solr, generating thumbnails, movie format conversion), so I need to get at the files remotely. Doing this over network shares seems dodgy...
    • Dealing with permissions on the filesystem as sometimes given us problems in the past, although now that we've moved to a pure Linux environment this should be less of an issue.

    So, my main questions are

    • What are the downsides of storing files as BLOBs in MySQL?
    • Do the same problems exist with NoSQL systems like Cassandra?
    • Does anyone have any other suggestions that might be appropriate, e.g. MogileFS, etc?

    解决方案

    Not a direct answer but some pointers to very interesting and somehow similar questions (yeah, they are about blobs and images but this is IMO comparable).

    What are the downsides of storing files as BLOBs in MySQL?

    Do the same problems exist with NoSQL systems like Cassandra?

    PS: I don't want to be the killjoy but I don't think that any NoSQL solution is going to solve your problem (NoSQL is just irrelevant for most businesses).

    这篇关于Web应用程序的文件存储:文件系统vs DB与NoSQL引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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