Thursday, October 18, 2007

Astoria - Data Services

The goal of the Astoria project is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over HTTP, and URIs are used to identify the various pieces of information available through the service. Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.

For more, check out http://astoria.mslivelabs.com/

Why is this cool? Because it takes the concept of web services to an entirely different level - from sharing business logic exposed by partners to sharing data for consumers in an easy and application-independent manner. How is this different from consuming data as a web service? Well, a web service exposes a method or set of methods that get you the data. The data itself is not addressable or identifiable. With Astoria, Microsoft aims to provide you a simple way of addressing the data elements exposed through the data service using URIs.

For example,
The URI that will represent all of the Customer entities in an example Astoria data service would be:

http://myserver/data.svc/Customers

In this context, the "/Customers" part of the URI points to the Customers entity-set, which is the container for Customer instances. It is also possible to point to a single particular entity using an URI, for example:

http://myserver/data.svc/Customers[ALFKI]

This URI results in a single Customer entity whose key, as defined in the EDM schema, has a value of "ALFKI". If each of the customers in the data service has a set of Sales Orders associated with it, the following URI would represent the set of Sales Orders associated with the Customer whose key has a value of “ALFKI”.

http://myserver/data.svc/Customers[ALFKI]/Orders

For URIs that represent a specific entity instance or a specific association, not only it is possible to use HTTP GET to retrieve the entity, but the system also handles HTTP PUT to replace an entity (effectively updating the values in the data service), HTTP POST to create new entities and HTTP DELETE to eliminate entities from the data service and its underlying store.

Astoria Online Data Store

There is new class of applications emerging on the web where an obvious “data storage server” is not available. Mashups are an example of a new type of web application that, today, is basically stateless. While mashups have access to data across the entire internet, they can only consume that data. They cannot store their own data on the web (without a custom back-end service to do so). The Astoria online service offers just such a data source that can be combined with other external sources. A second example is internet-enabled desktop applications. These applications are not delivered through or executed inside a web browser, but still connect to the internet to retrieve and store data.

The Astoria online service is an experimental service that aims at exploring programming models for data on the web, offered in the form of a service.
Using the Astoria online service, web developers can create custom structured data stores on the web and access them from anywhere that they have internet access. These data services can then be the storage or data source for mashups, or the backing store for internet enabled applications, or be applied to any other scenario where a rich data service on the web is required, independently of where it is hosted.

3 comments:

Jatinder Singh said...

Microsoft going REST way, pretty cool!

RoR embraces REST and has got any amazing support for developing RESTified applications.

Arati Rahalkar said...

This maps to the REST architecture style. Is that right?

Siddhesh said...

Yes, you could say this is along the REST principles - here's what Wikipedia throws up for REST:

An important concept in REST is the existence of resources (sources of specific information), each of which can be referred to using a global identifier (a URI). In order to manipulate these resources, components of the network (clients and servers) communicate via a standardized interface (e.g. HTTP) and exchange representations of these resources (the actual documents conveying the information).