2 Replies Latest reply on Jan 14, 2015 1:02 PM by Ryan Chesnut

    ModeShape as a file repository

    Ryan Chesnut Newbie

      Hello, my company is researching using ModeShape to create a file repository to link to an SQLDB. Currently, we are using a regular file server that creates a unique folder and file hierarchy to store each pdf file. Two problems we are running into are: first,  extFat has a limitation of 64k folders and second, if files are moved in the file system, they are de-referenced in the DB. This leads to my  questions. Would the ModeShape repository incur a folder number restriction and are records in the repository lockable? I am very new to JCR  and repositories in general.

        • 1. Re: ModeShape as a file repository
          Randall Hauch Master

          You can very easily create a web service (or even use our WebDAV service) to store files like you were, and you could give it a try using the same "folder" structure you were using. If that doesn't perform well, then you could try a different "folder" structure. The bottom line is that there is a practical performance limit to the maximum number of child nodes underneath a parent node, but what that limit is varies significantly with how you access and use the repository. There's not much getting around it, either: ModeShape (and all JCR repositories) are hierarchical data stores. If you'd rather store a very flat structure, you should consider another technology.


          Interestingly, you might not need to store that extra file hierarchy, since with ModeShape you can store extra information as properties either on the file node or it's "content" child node. (This is a common pattern in JCR for storing files, but it's not the only way to do it.) This may provide an advantage for your systems.


          As for moving files around, that's actually very easy and cheap to do in ModeShape because the content of the stored file (which is likely the largest piece of data) is actually not stored in the same place as the node representing the file. Rather, the content is stored in a property value on a node that represents the file, and people generally use BINARY values to store file content. Unlike all other value types, BINARY values are stored in a special binary store -- there are several kinds of binary stores to choose from, including a very efficient file system binary store.


          are records in the repository lockable?

          That depends on what you mean. Nodes can be locked in JCR, but that's more of a temporary measure more suited for eliminating concurrency conflicts in your app. Another option is to use ACLs to limit access. You'd have to be more specific for us to give a more detailed response.


          I hope this helps.

          1 of 1 people found this helpful
          • 2. Re: ModeShape as a file repository
            Ryan Chesnut Newbie

            Thank you for your prompt response!  I'm sure as I dig more into this I'll have more questions and it's good to know questions are answered quickly.