Pergunta

currently I'm wondering how do I manage a large number of users in modeshape that have their own data (with almost nothing shared). An example of the problem that I'm currently thinking about is the Dropbox model: Everyone has its own dropbox with private files, not necessarily shared with someone else.

Shall I create a new workspace for every user, or would it be better to have a large tree, where under the root node, there are nodes for all users?

Is the number of modeshape workspaces limited?

Thanks for any hints.

Foi útil?

Solução

There is a practical limit to the number of workspaces in ModeShape, since they need to be managed and this management was not designed to support an unlimited number of workspaces. Generally, JCR implies some specific behavior between workspaces, and workspaces were never intended by the JCR folks to be used separate users' independent data.

I would suggest using a single repository and workspace to store all content for all users, where the workspace's hierarchy of nodes is used to segregate and associated content with particular users. Just be aware that JCR is specifically a hierarchical database: don't put all users below a single node, since that would create a really flat hierarchy (that doesn't work well in any JCR implementation). Instead, simply create a small hierarchy based upon your usernames or user IDs. (Note that even file systems have their limit: you can't put millions of files in a single folder.)

Really, this is not that different than if you were to use a relational database to store data for lots of users. Few architectures would create a new database for each user; instead, the service would likely use a single database in which each row is associated with a single user, and the service does the security and enforcement.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top