In Asset Bank, storage devices are configurable areas of storage for digital files. A storage device can contain the asset files themselves and/or files created by the system for various operational purposes (thumbnails, converted versions, preview video clips, exported metadata, etc.).
A storage device relates to a directory on a local or mapped/mounted network hard drive accessible via the server's local filesystem or an Amazon S3 bucket.
By default, a single unlimited storage device is configured to store both asset files and system files within a directory called 'files' within the application filespace. This will be suitable for many installations, but in situations where more control is required, it is possible to reconfigure the default storage device and/or add further devices.
Admin users can add new devices from the Admin > System > Storage Devices menu. Select the type of device to add (File System, Amazon S3) and click Add.
Asset Bank supports one type of cloud storage service: Amazon S3. We recommend Amazon S3 because:
- S3 versioning provides an extra level of safety because it allows accidentally deleted files to be recovered
For any assets that are stored in a "remote" cloud storage device - such as Amazon S3 - it is possible to allow users to download files directly from the cloud storage. If you enable this feature, when a user clicks to download an asset from Asset Bank, the file will be served to them directly from the cloud storage, rather than first being downloaded to the Asset Bank server and then served from there. This difference should not be visible to the user, however, it may improve download speeds and reduce the amount of server network traffic. To enable this feature, change the download-remote-storage-directly=false setting to true and restart Asset Bank. NOTE (for API users): If you enable this feature the AssetContentResource described in the Asset Bank REST API documentation will no longer directly return the content of an asset, it will return a redirect to the direct download url of the asset from the remote storage. Your development team would need to make sure anything consuming the REST API can handle receiving redirects from that resource.
Below is a description of the configuration options for each device.
A textual identifier for the device (i.e. 'Asset storage on server X' or 'Storage on Amazon S3').
What type of resources will be stored in the device: system files, asset files, thumbnails, a combination of the above or embedded files. 'System files' refers to any versions of asset files that are created by the system for displaying within the application, plus temporary files created for a variety of purposes such as uploading, caching, importing, exporting, etc.
The filesystem path of the device. This could be the path to a mapped/mounted network location or a path inside Asset Bank's directory. Be aware that Asset Bank's performance will be impacted by accessing files across a network.
Base Url Override (Local & Embedded only)
Alternative URL to serve the images from (allows images to be served by a server other than Tomcat - i.e. Apache). Requires the webserver to be setup prior to this field being populated.
Bucket Name (Amazon S3 only)
The S3 bucket name to use for storage.
Note that versioning must be enabled on the bucket for Asset Bank to function correctly if the bucket is going to be used to store Asset files (conversely if the bucket is going to be used exclusively for thumbnails or system files then versioning isn't required).
API Key (Amazon S3 only)
The key associated with the Amazon S3 account or IAM user that you want Asset Bank to use to access S3. The user / account will need full access to the Amazon S3 bucket that the Asset Bank is going to use.
Secret Key (Amazon S3 only)
The secret key associated with the Amazon S3 account or IAM user that you want Asset Bank to use to access the Amazon S3 bucket.
Container (Rackspace Cloud Files only)
The name of the rackspace container to use for storage (e.g. assetbank-container)
API Key (Rackspace Cloud Files only)
The api key associated with the Rackspace account.
Account Name (Rackspace Cloud Files only)
The name of the rackspace account that created the container.
Is Relative (File System only)
Whether the provided Path is relative to the Asset Bank web application root ([tomcat]/webapps/asset-bank), or an absolute path (which should start with a '/').
If necessary, a maximum storage limit can be provided for each device. Rather than being necessarily related to the physical size of the disk, this is a configurable maximum that allows you to limit the amount of space used by Asset Bank on a particular device (although clearly it doesn't make sense to make this more than the physical disk can accommodate). Once this limit is reached (given the safety margin - see below) Asset Bank will consider the device full and will look for another device in which to store files.
To try and ensure that the storage limit set for a storage device is not exceeded, there is a configurable 'safety margin' for each file device type. Asset Bank will consider a device full if it's used space (according to the last assessment), plus the configured safety margin, is within the configured storage limit. Since (with default settings) the usage data may be up to 4 hours out of date, the safety margin should reflect an amount of space that is unlikely to be filled in this time.
The default settings for the safety margins for asset and system files are 100Mb and 1Gb respectively. If it is critical that each device's limit is not breached, it may be necessary to i) increase the frequency of the space usage scans by reducing the value of setting storage-device-usage-update-period-minutes and/or ii) increasing the safety margins.
The storage limit for a particular device can be changed at any time, so more space can be allocated to a device that is regarded full, for example. If the space allocation for a device is reduced, this will not reduce the number of files already stored on the device but may prevent further files from being stored if the remaining space becomes less than the configured safety margin.
It is possible to 'lock' a storage device to prevent it from being used for future file storage without affecting the files currently stored. Note that when a storage device that stores System files is locked, it may still be used (until the next system restart) for cached converted images. It is unlikely that the overall space requirement will grow significantly, but new cached versions of files may be stored on the device.
Use category names as folders
If a storage device supports using category names as folders, then this option will appear in its edit page. This enables using the category hierarchy as a folder hierarchy within the storage device. This means that if an asset is assigned to the category 'Documents' for example, it will appear in a folder named Documents in the storage device as well. Changing the asset's assigned category also moves it to the appropriate folder in the remote storage device.
When this is enabled, existing categories which correspond to a folder will be renamed, moved and deleted along with the category. Non-empty categories cannot be deleted if this featured is enabled, the assets in the category have to be moved first.
Please Note: While assets are able to be assigned to multiple categories, they will only exist in one of the category named folders in the storage device. This category will be the one which was first assigned to the asset.
Warning: In order to avoid losing track of your category folders, please refrain from moving, renaming or deleting remote folders directly from the remote storage web interface.
Locking Storage Device Editing
In order to prevent the configuration of storage devices from being edited, it is possible to lock the current configuration by changing application setting storage-device-edit-lock from false to true. Obviously this process would need to be reversed in order to subsequently make further changes.
Deleting Storage Devices
It is generally not a good idea to delete storage devices if this can be avoided. If you do need to do this, clicking the delete link next to the storage device will take you to a page that will try and inform you about how the storage device is currently used. Pay close attention to any warnings on this page before continuing. Deleting a storage device that is currently being used for asset or system storage is likely to result in errors.
Migrating Storage Devices
In recent versions of Asset Bank there is the ability to migrate any Asset related files (original file, thumbnail, preview image, preview clips, large image popups etc.) from one storage device to another. Clicking on 'migrate' next to a particular storage device will take you to a page that shows you which other storage devices are suitable to receive the asset files.
Once you have selected a destination device to migrate to, starting the migration will take you to a page that refreshes showing the progress of the migration and the files that have been copied.
Things to note:
- Migrations will only move Asset files. System files will NOT be moved.
- If the migration is interrupted (by a Tomcat/webapp restart) successfully migrated assets WON'T be rolled back. Also there may be a single asset in an inconsistent state (i.e. files not where the database specifies, index not up to date) that needs to be fixed manually.