Menu

cloud storage support

2016-08-24
2016-08-27
  • Stefano Gironella

    Hi, I'm doing some practice on SeedDMS and it looks really good to me.
    The only thing I'm missing is how to use a cloud storage service instead of the web-server file system for storing documents.

    I've seen that SeedDMS 5.X brings hooks and extensions support but I think that's not what I need to archive my goals.

    Basically I'm trying to POST my storage-as-a-service backend when saving new documents, keep track of remote file identifier in a custom table within SeedDMS database and retrieve file content doing a GET to my cloud service.

    I've seen that file system operations are implemented within pear/SeedDMS/Core/inc.FileUtils.php class and the domain logic is almost within pear/SeedDMS/Core/inc.ClassDocument.php class.

    At the moment I see 2 scenarios:
    1. create a new Core class that extends inc.ClassDocument.php and implement file-system related methods so that they will use my cloud service instead of the local file system
    2. create a custom extrension to do the job

    Solution 1 is the worst, because it will lead to change core classes and I would avoid this.

    Solution 2 is my best choice and could give me the ability to switch from a cloud storage service to another (Amazon S3, Google Drive, ....) in a really neat way defining an abstract meta-class and services-specific driver classes to implement CRUD operations to my documents.
    This solution, however, will not override inc.ClassDocument.php class, so his methods would countinue using local file-system.

    Any ideas on how to implement this in a clean way?

    Thank you wery much for your support.

     
  • PMan

    PMan - 2016-08-27

    I was looking into doing this for another project (resourcespace). I didn't get very far, but here are the links I found during my research:

    https://gist.github.com/heyarne/2823f0c1eac9ad41c7ecfb21f2bec9cb#installation
    this is a how-to for storing media files to S3 using a fuse file system called goofys.

    https://github.com/kahing/goofys/
    this is the link to the goofys github page. goofys is a fuse file system for linux that mounts a network file system, but actually stores the files to S3. This github page has benchmarks, and lots of good information. It looks to be a well-supported project.

    Using goofys, you would mount a (goofys-created) folder that connects to S3 on your machine, then you use a symlink pointing to the goofys folder to replace the seedms storage folder .

    It turns out there are several options for fuse file systems tht will mount a folder that connects to S3 or Rackspace or whoever. S3FS is another one, but doesn't seem to be supported anymore.

    Hope this helps!

     

    Last edit: PMan 2016-08-27

Log in to post a comment.