Something to add to the original post:
The reality is that customer don't have the resource or expertise to provide us with a well specified requirement. The way it worked out is that we provide an sofeware specification based on some of the understanding we have:
1. Customer would require the new system be integrated in with legacy system;
2. The new application should be comparable in terms of the service offerring the market leader Flikr provides.
3. The new application has to be delivered within a 6 month time frame.
4. The new application has to design with security, performance, scalability and reliablity in mind.
One most important design decision we made is to take RESTful approach. There are two main reasons for that decision:
1. The web is built on this REST idea.
2. RESTful concept is very easy to understand and learn, learning curve is low for developers.
3. SOAP stack requires a lot of toolings. It addes complexity to the architecture, and it could be hard to understand to a deep level.
4. ATOM doesn't say anything about concurrency control, but HTTP response header ETag could provide such functionality.
One important requirement for new system is to integrate with the existing infrastructure. The ISP has made a significant investment in the existing infrastructure (custom framework layer on top of J2EE and HSM). In particular account and backup management provide significant differentiation. The new system needs to hide the actual implementation of custom API and HSM.
With the new API, the storage of data and metadata is performed by the same operations, which are the standard HTTP verbs: GET, POST, PUT, and DELETE. However, data and metadata are operated on separately: data is uploaded or downloaded via standard files, as identified by MIME types. Metadata, on the other hand, is represented using a XML schema (extending Atom through XML namespaces).
All the metadata are stored in Oracle database. All collections actually correspond to database queries on metadata. This gives significant flexibility.
Another important requirement is high performance. In particular, the new API must be designed to use the existing web infrastructure in an optimal way. It should use compression, caching, virtualization, and other mechanism. It must support direct path access for common operations, especially read access.
The design decision made to achieve this high performance requirement is to directly serving files via NFS mount.
Now I will talk about security requirement and ACL.
Since the new system is RESTful, it means that resources are identified by URLs. We knew customer would want to have all URLs secured. All URLs go through an authorization phase using whatever authentication credentials a user agent presents. This could be basic, digest, WSSE, or cookies. Security can be public, shared, or private.
We evaluated LDAP as solution for authorizationand determined that the solution might be an overkill for our purpose. The alternative solution was to use Association tables for ACL.
We used open source package Twisted to implement most of the server functionality. The reason is that it has a very simple model for coordinating threads and async I/O, which minimizes the overhead necessary for sharing complex results. However, it is necessary to do resource authorization ealier. So Apache is responsible for securing resources, basing on the authentication credentials presented by the user.
-Angela
Wednesday, October 24, 2007
RESTful approach to design SOA application (1)
This is based on my last project from my previous company. We preferred a RESTful approach to build our application.
We were charged to build a value add service for one of the biggest ISP provider in a foreign country. What our customer had in mind was Flickr like service offering. The solution must be designed to use the existing web infrastructure in an optimal way, and meet the high performance, low cost, security, reliability and usability objective.
To minimize development costs and lock-in risks, we preferred using an available API. Atom API's simplicity design presents itself a good candidate. Atom API is a REST implementation of a SOA. There are two aspects to the Atom API:
* Atom Syndication Format (ASF). ASF is directly comparable to RSS.
* Atom Publishing Protocol (APP). This protocol describes a usage of the REST web service style refined for use for the management of web resources.
(Atom also has a SOAP interface. it could provide further usability if needed.)
For the rapid delivery of leading services, the following objectives and means are employed:
* Apache is used to manage client connection.
* Direct execution paths. Serve files directly via a NFS mount.
* Caching. REST interfaces can take advantage of existing world-wide caching infrastructure.
* GET of a resource and POST to a container directly usable by a standard web browser, via a standard forms-based interface. AJAX can directly consume Atom interfaces, via DOM, XPath, or XSLT.
* Container model; queries can be containers.
* Publish-subscribe offer significant flexibility, since it is based on containers.
* Gatewayable to RSS.
* Extensible metadata model.
* Division of responsibility for Data and Metadata.
o This virtualization enables the division of infrastructure responsibility.
o Metadata can be associated with one or more collections, linking to any corresponding data files.
o Metadata is typically more volatile than stored multimedia data - tags may be changed, albums composed of multimedia files, etc. - but the original multimedia file will rarely be changed. Caching, through expiration and validation, can take advantage of this.
As a SOA, here are some standard phases that this request will go through: load balancing(via specialized applicance, DNS round robbin, or rewrite), cache management (entry/validation/expiration), authentication, authorization, namespace management(URL rewriting to a filesystem) to the URL. However, these are relatively lightweight phases, applied at the document level. Then the file itself is directly retrieved.
For data files, the natural point of integration with existing infrastructure is through the account of the data file owner. The account is treated as a collection.
For managing metadata, we prefer the declarative operations vs procedural. Some of the advantages of being declarative are:
* File transformations can be thrown away – classic time/space tradeoff – since they can be reapplied if desired.
* Listing associated tags makes sense in the metadata.
-Angela
We were charged to build a value add service for one of the biggest ISP provider in a foreign country. What our customer had in mind was Flickr like service offering. The solution must be designed to use the existing web infrastructure in an optimal way, and meet the high performance, low cost, security, reliability and usability objective.
To minimize development costs and lock-in risks, we preferred using an available API. Atom API's simplicity design presents itself a good candidate. Atom API is a REST implementation of a SOA. There are two aspects to the Atom API:
* Atom Syndication Format (ASF). ASF is directly comparable to RSS.
* Atom Publishing Protocol (APP). This protocol describes a usage of the REST web service style refined for use for the management of web resources.
(Atom also has a SOAP interface. it could provide further usability if needed.)
For the rapid delivery of leading services, the following objectives and means are employed:
* Apache is used to manage client connection.
* Direct execution paths. Serve files directly via a NFS mount.
* Caching. REST interfaces can take advantage of existing world-wide caching infrastructure.
* GET of a resource and POST to a container directly usable by a standard web browser, via a standard forms-based interface. AJAX can directly consume Atom interfaces, via DOM, XPath, or XSLT.
* Container model; queries can be containers.
* Publish-subscribe offer significant flexibility, since it is based on containers.
* Gatewayable to RSS.
* Extensible metadata model.
* Division of responsibility for Data and Metadata.
o This virtualization enables the division of infrastructure responsibility.
o Metadata can be associated with one or more collections, linking to any corresponding data files.
o Metadata is typically more volatile than stored multimedia data - tags may be changed, albums composed of multimedia files, etc. - but the original multimedia file will rarely be changed. Caching, through expiration and validation, can take advantage of this.
As a SOA, here are some standard phases that this request will go through: load balancing(via specialized applicance, DNS round robbin, or rewrite), cache management (entry/validation/expiration), authentication, authorization, namespace management(URL rewriting to a filesystem) to the URL. However, these are relatively lightweight phases, applied at the document level. Then the file itself is directly retrieved.
For data files, the natural point of integration with existing infrastructure is through the account of the data file owner. The account is treated as a collection.
For managing metadata, we prefer the declarative operations vs procedural. Some of the advantages of being declarative are:
* File transformations can be thrown away – classic time/space tradeoff – since they can be reapplied if desired.
* Listing associated tags makes sense in the metadata.
-Angela
Subscribe to:
Posts (Atom)