Wednesday, October 24, 2007

RESTful approach to design SOA application (2)

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

No comments: