Storage API
Storage API is a framework for enterprise-level file storage and serving.
It has the following features:
- Pluggable architecture - it can be extended to work with any CDN.
- Redundancy - it can be configured to store your files in multiple CDNs and instantaneously change which one is serving. This means your site will not be brought down by a CDN having problems.
- Access control API - can be used for e-commerce.
- Deduplicity - when files that are identical are stored in the same container, only one instance will be created. This saves bandwidth and storage.
- Aggressive client side caching - the browser is instructed to keep files fresh in its cache, without ever checking if they have been updated. This is possible because Storage API will never reuse a URL.
At the moment, it can only be used by modules that utilise it directly, e.g. Blue Droplet Video.
With Drupal 7 it will be possible for core files to utilise Storage API with a new hook called hook_file_url_alter() .
The service and access control APIs are documented in the source code directly in Doxygen format.
Storage API depends on MimeDetect.
Services
Each storage service is implemented as a module. The following service modules come with Storage API:
- Filesystem / Drupal - files are stored in a local directory and served via Drupal.
- Database - really just a proof of concept. All files are stored in the database.
- FTP - files are uploaded to a directory via FTP. A URL prefix can be defined for serving.
- Amazon S3 - files are uploaded to a 'bucket'. Serving is handled by S3. Also supports time-limited cryptographically-signed URLs.
Rackspace Cloud is a great candidate for a new service module.
Containers
Containers are where files are stored. They are created by a site administrator.
Each container is an instance of a service. It stores information specific to the service that describes the container. For local storage, it is a directory path. For Amazon S3 it is credentials and a 'bucket' name.
Classes
Classes are also created by a site administrator. A class consists of any number of containers. Containers are prioritised within the class. Containers nearest the server are at the bottom. Containers nearest the client are at the top.
Modules that utilise Storage API can allow different classes to be selected for files that have different use-cases. For example, some files may need to be backed up with FTP, whereas other files can regenerated on the fly.
Files are initially stored in the lowest priority container (nearest the server). During cron run, Storage API attempts to propagate the files to every container in the class.
Files are served from the highest priority container in the class that has an instance of the file.
Releases
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2009-Nov-03 | 34.7 KB | Download · Release notes | Development snapshot | |
