Astoria: Microsoft's RESTful Data Services
Microsoft's RESTful Data Services
[...]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.
The Microsoft Codename "Astoria" Overview document shows how data is addressed and represented by Astoria data services. In order to address data with Astoria data services the following addressing scheme is used: http://host/vdir/
Predicates can be integrated into resource URIs, e.g. http://myserver/data.svc/Customers[City eq 'London'], as well as query string options, which control the output:
<DataService xml:base="http://myserver/data.svc"> <Customers> <Customer uri="Customers[ALFKI]"> <CustomerID>ALFKICustomerID> <CompanyName>Alfreds FutterkisteCompanyName> <ContactName>Maria AndersContactName> <ContactTitle>Sales RepresentativeContactTitle> <Address>Obere Str. 57Address> <City>BerlinCity> <Region /> <PostalCode>12209PostalCode> <Country>GermanyCountry> <Phone>030-0074321Phone> <Fax>030-0076545Fax> <Orders href="Customers[ALFKI]/Orders" /> Customer> Customers> DataService>
The root "DataService" always contains the base URI of any resource represented by the service. Navigational nodes, which represent associated resources, contain relative URIs. In the example the orders of customer "ALFKI" are pointed to by the concatenation of the base URI (within the root node) with the relative URI (within the Orders node): "http://myserver/data.svc" + "/" + "Customers[ALFKI]/Orders".
According to Microsoft Astoria offers an easy way of implementing RESTful web services primarily targeted at providing data. In addition to GETting data from a data service data can also be updated or inserted via HTTP PUT or HTTP POST.
But I’ve got to say, I’ve been against these “data services” from day one. The REST style is most applicable for large, chunky resources - while this seems to be targeting single tables in the database. Look at this discussion on REST vs SOA for some examples.
Martin Thompson Jul 27, 2014