Added by Wil Sinclair, last edited by Wil Sinclair on Oct 16, 2009  (view change)

Labels

 
(None)

Zend Framework: Zend_Cloud_Storage Component Proposal

Proposed Component Name Zend_Cloud_Storage
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Cloud_Storage
Proposers Wil Sinclair
Zend Liaison TBD
Revision 0.2 -16 October 2009: Initial Draft. (wiki revision: 10)

Table of Contents

1. Overview

Zend_Cloud_Storage is a component in the Simple Cloud API that provides a common API for cloud application storage services, such as Amazon S3, Windows Azure Blob Storage, or Nirvanix. The design goals of this API include simplicity, portability across cloud storage services, stability, and extensibility for future expansion.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component must support uploading strings as files.
  • This component must support downloading files as strings.
  • This component should support uploading streams as files.
  • This component should support downloading files as streams.
  • This component must support deleting files.
  • This component should support listing files by namespace.
  • It would be nice if this component provides a simple directory system.
  • It would be nice if this component provides support for handling containers and buckets.
  • This component should support fetching file metadata.
  • It would be nice if this component supports putting metadata.
  • It would be nice if this component supports deleting metadata.
  • This component should provide a download URL for unauthenticated and/or shared-access users.
  • It would be nice if this component supports access control on a file level.
  • It would be nice if this component supports access control on a directory level.
  • This component must provide consistent error handling for all adapters.
  • This component should handle errors identically for common error conditions at the client library level.
  • This component must provide an interface that can be implemented by adapters- whether they ship with Zend Framework or not.
  • This component should provide adapters for all cloud storage client libraries that ship with Zend Framework.
    Zend_Session.

4. Dependencies on Other Framework Components

  • Zend_Exception
  • Cloud storage client libraries under the Zend_Service namespace.
  • Zend_Http_Client

5. Theory of Operation

Although there are some differences in the storage APIs offered by cloud vendors, there is a set of common runtime operations that can be supported by a unified API. Note that unique value-add offerings such as the media operations in Nirvanix and the sharing features in Box.net are not supported. Azure also offers value-add features, including support for management of large files, that are not supported in this API.
The API follows a more 'functional' model, as opposed to an OOP paradigm, to more easily model services available via RESTful, SOAP, and RPC interfaces. Such an API will also negligibly affect performance, while allowing users to build their own object-oriented data access libraries on top of the simple methods it exposes.
This proposal covers only components implemented for Zend Framework, but these interfaces and classes have been designed to be implementable in other languages and/or package structures.
Open issue: Should we support access control in the API?
Open issue: Zend_Http_Client does not currently support streaming. This functionality must be added.

6. Milestones / Tasks

  • Milestone 1: [DONE] Simple Cloud API project launched.
  • Milestone 2: Community review sufficient to submit proposal for recommendation.
  • Milestone 3: Implement API and adapters in Zend Framework trunk.
  • Milestone 4: Document API.
  • Milestone 5: Address issues as necessary for production release.

7. Class Index

  • Zend_Cloud_StorageService
  • Zend_Cloud_Storage_Factory
  • Zend_Cloud_Storage_Exception
  • Zend_Cloud_Storage_Adapter_S3
  • Zend_Cloud_Storage_Adapter_Azure
  • Zend_Cloud_Storage_Adapter_Nirvanix
  • Zend_Cloud_Storage_Adapter_Rackspace
  • Zend_Cloud_Storage_Adapter_FileSystem

8. Use Cases

UC-01 - Get instance of adapter

  1. Call static method on factory class
  2. Use it
UC-02 - Upload file
  1. UC-01 - Get instance of adapter
  2. Call store file with data in string
  3. Store request ID if necessary
UC-03 - Store file
  1. UC-01 - Get instance of adapter
  2. Call fetch file and save as a string
  3. Store string
UC-04 - Delete file
  1. UC-01 - Get instance of adapter
  2. Call delete string
  3. Store request ID if necessary

9. Class Skeletons

Wil,

This looks really good. Will this replace the current Zend_Service_Amazon_S3 or just provide hooks into what is currently there and being maintained.

Once this gets approved I'll be more than happy to help out with the S3 implementation.

Jon

It will simply provide an adapter from this interface to Zend_Service_Amazon_S3. I actually wrote that adapter already (it's practically a no-op) and it works well. It will need to be refactored as we update the API, however, and I'd love your help there.

I'll post the code soon so that we have something to look at.

,Wil

No ACL related items/methods in this class?

Great question. I actually had that as an open issue in the doc I was working off of. I'll add it here. I'll update the proposal.

The main question that I had is whether the authorization functionality is similar enough across all services. And what should auth support look like?

Maybe you can help answer these questions.

,Wil

I'm wondering what you'd do in case they are different.

E.g. one of the things I've used a lot in the past are those S3 links that are only valid for so and so long. I totally get the idea you're trying to push through here, but I wouldn't take off features and not support them just 'cause not all vendors offer the same set of features.

What do you suggest people do if they still need it?

Or would that be an adapter specific implementation? It sounds like it could get messy.

The answer so far has been to go down to the client lib for vendor-specific functionality.

We could consider an extension API, however.

Since this is a discussion that pertains to all Simple Cloud interfaces, we should discuss it here: http://www.simplecloud.org/forum/topic/open/id/323

,Wil