AppSuite:File Storages per User

Revision as of 08:16, 27 August 2015 by Thorben (talk | contribs) (Motivation)
This information is valid from 7.8.0

File Storages per user

This document tries to outline and explain the new concept of having the possibility to specify file storages on a per user basis that is introduced with Open‐Xchange Server v7.8.0.

The previous situation

Before the introduction of the file storages per user feature, it was only possible to specify the file storage association per context. That file storage was used for all modules/functions that are supposed to store/retrieve files:

  • Drive
  • Thumbnails
  • PIM attachments
  • Signature attachments

File storages are registered and maintained in file store table held in configDb database. File storage obtains a unique identifier, a base URI and a size limitation.

For each context a file storage identifier is specified alongside with a context quota that defines how much space that context is allowed to occupy in assigned file storage. Thus the sum of all quotas from those contexts assigned to file storage must not exceed the file storage’s size.

One file storage per context

Motivation

The motivation is to differentiate between file storages for common context‐associated files and Drive file. Those Drive files may further reside in the common context‐associated storage, but it also possible to specify user‐associated file storages where Drive files are maintained. The association is determined based on a folder's creator/owner: The quota gets accounted to that user that created a folder (provided the user has a user‐associated file storage).

Differentiate

That kind of separation allows different provisioning scenarios that an administrator possibly wants to achieve.

  • Slow mass storage vs. fast Drive storage setup
  • OX Drive Stand‐Alone setup

When assigning dedicated file storage for Drive to a certain user, the user’s file occupation is no more accounted to the overall context in which that user resides, but gets accounted to a dedicated user quota. Such a user quota can be used for different sales strategies that include tracking the user’s file occupation.

To achieve the file storage association on a per user basis, the existing user table has been enhanced by file storage and quota information as it is for the context table. Moreover the filestore_usage table has also been enhanced by the capability to account storage occupation to a certain user

Enhancements

In addition the user table has also been extended by filestore_owner column. That column is used to let a user’s file storage be combined with another user’s storage. This serves the scenario in which a grouped OX Drive Stand‐Alone setup is operated. Multiple users’ file occupation gets accounted to a master user account.

Furthermore Open‐Xchange allows changing the running setups at any time to adjust the file storage usages/associations according to possibly changing needs/requirements.

Note

Please note that with introducing the concept of having user-associated file storages, the output for "listfilestore" command-line tool changed. Since also a user can be accounted to a file storage's capacity, the output changed to be:

/opt/open-xchange/sbin/listfilestore -A oxadminmaster -P secret
 id path                      size reserved used max-entities cur-entities
  2 file:///var/opt/filestore 1000      300    0         5000            2

Hence, "maxctx" is replaced with "max-entities" and "curctx" is replaced with "cur-entities"

Seamless integration and flexibility

The new more flexible approach fits seamlessly into existing context/file storage setups. Thus there is no need to change anything, unless demanded by administrator

The fall‐back setup

The fall-back setup

Everything stays as is. There is a storage‐per‐context association and every file is held in that storage. There are no user‐specific file storage attributes set in user table.

Slow mass storage vs. fast file storage setup

Slow mass storage

There are two storages available: a file‐based and an S3 storage (assuming that the S3 one would be faster). While the context has the file‐based storage set, users in that context do have individual name spaces in the S3 storage.

That way common files (PIM/Signature attachments, thumbnails) are stored to context‐ associated file‐based storage while Drive documents are stored in the individual user name spaces in the S3 storage. Every user is allowed to occupy up to 10GB of space in the S3 storage (this can be varied as well).

OX Drive Stand‐Alone – Single User

OX Drive Stand-Alone - Single User

Again there two file storages. Again the file‐based one is assumed to serve the slow mass storage behavior while S3 is assumed to be the fast storage.

Context designated to the Single User scenario for OX Drive Stand‐Alone operation, do hold only one user that has its individual name space associated in the S3 storage.

Again common files (PIM/Signature attachments, thumbnails) are stored in the context‐ associated file‐based storage while Drive documents are stored in the individual user name spaces in the S3 storage of each context. Every Drive document accounts the user‐sensitive quota of the associated user.

OX Drive Stand‐Alone – Business Account

OX Drive Stand-Alone - Business Account

There two different file storages as in the previous setups. Again the file‐based one is assumed to serve the slow mass storage behavior while S3 is assumed to be the fast storage.

For this setup users do not hold their own individual name space in the S3 storage, but all share the same name space of the master user in the S3 storage. Moreover there are no dedicated user quotas, but all Drive documents do account to the master user’s quota

Extensions to provisioning command‐line tools

createuser

The existing createuser CLI is enhanced by the following options

‐q/‐‐quota The file storage quota in MB for associated user
‐f/‐‐filestore The identifier for the file storage.
‐o/‐‐owner The owner for the file storage. If no owner is given and f/filestore option is set, the user itself is taken as owner

changeuser

The existing changeuser CLI is enhanced by the following option

‐q/‐‐quota The file storage quota in MB for associated user

movecontextfilestore2user

Move a user’s files from a context to an individual storage name space.
Usage: movecontextfilestore2user

‐h,‐‐help	Prints a help text
‐‐environment	Show info about commandline environment
‐‐nonl	Remove all newlines (\n) from output
‐i,‐‐userid <userid>	| Id of the user
‐u,‐‐username <username>	| Username of the user
‐A,‐‐adminuser <adminuser>	? Admin username
‐P,‐‐adminpass <adminpass>	? Admin password
‐c,‐‐contextid <contextid>	| The id of the context
‐N,‐‐contextname <contextname>	| context name
‐f,‐‐filestore <filestore>	* The identifier for the file storage.
‐q,‐‐quota <quota>	* The file storage quota in MB for associated user.


Entries marked with an asterisk (*) are mandatory. Entries marked with an question mark (?) are mandatory depending on your configuration. Entries marked with a pipe (|) are mandatory for one another which means that at least one of them must be set.

moveuserfilestore2context

The counterpart for the previous CLI. Move a user's files from his individual storage name space to the context storage name space.
Usage: moveuserfilestore2context

‐h,‐‐help	Prints a help text
‐‐environment	Show info about commandline environment
‐‐nonl	Remove all newlines (\n) from output
‐i,‐‐userid <userid>	| Id of the user
‐u,‐‐username <username>	| Username of the user
‐A,‐‐adminuser <adminuser>	? Admin username
‐P,‐‐adminpass <adminpass>	? Admin password
‐c,‐‐contextid <contextid>	| The id of the context
‐N,‐‐contextname <contextname>	| context name

Entries marked with an asterisk (*) are mandatory. Entries marked with an question mark (?) are mandatory depending on your configuration. Entries marked with a pipe (|) are mandatory for one another that means that at least one of them must be set.

moveuserfilestore2master

Move a user's files from his individual storage name space to the storage name space of specified master.
Usage: moveuserfilestore2master


‐h,‐‐help	Prints a help text
‐‐environment	Show info about commandline environment
‐‐nonl	Remove all newlines (\n) from output
‐i,‐‐userid <userid>	| Id of the user
‐u,‐‐username <username>	| Username of the user
‐A,‐‐adminuser <adminuser>	? Admin username
‐P,‐‐adminpass <adminpass>	? Admin password
‐c,‐‐contextid <contextid>	| The id of the context
‐N,‐‐contextname <contextname>	| context name
‐m,‐‐master <master>	Master user id. If not set, the context administrator is assumed to be the master user.


Entries marked with an asterisk (*) are mandatory. Entries marked with an question mark (?) are mandatory depending on your configuration. Entries marked with a pipe (|) are mandatory for one another, which means that at least one of them, must be set.

movemasterfilestore2user

Move a user's files from a master account name space to an individual storage name space.
Usage: movemasterfilestore2user

‐h,‐‐help	Prints a help text
‐‐environment	Show info about commandline environment
‐‐nonl	Remove all newlines (\n) from output
‐i,‐‐userid <userid>	| Id of the user
‐u,‐‐username <username>	| Username of the user
‐A,‐‐adminuser <adminuser>	? Admin username
‐P,‐‐adminpass <adminpass>	? Admin password
‐c,‐‐contextid <contextid>	| The id of the context
‐N,‐‐contextname <contextname>	| context name
‐m,‐‐master <master>	Master user id. If not set, the context administrator is assumed to be the master user.
‐f,‐‐filestore <filestore>	* The identifier for the file storage.
‐q,‐‐quota <quota>	* The file storage quota in MB for associated user.

Entries marked with an asterisk (*) are mandatory. Entries marked with an question mark (?) are mandatory depending on your configuration. Entries marked with a pipe (|) are mandatory for one another, which means that at least one of them, must be set.