The Artima Developer Community
Sponsored Link

Java Community News
Comparing Astoria and the Google Base API for Querying RESTful Resources

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Comparing Astoria and the Google Base API for Querying RESTful Resources Posted: Jul 27, 2007 12:41 PM
Reply to this message Reply
Summary
In a recent blog post, Dare Obasanjo compares Microsoft's new Astoria API with the Google Base API for querying URL-addressable Web resources.
Advertisement

The RESTful approach to Web development centers around exposing representations of resources via URLs, making such resources, or their representations, universally accessible. This approach conjures up the notion of the Web as a huge database: resources exposed via REST services are often similar to database entities, and resource representations share similarities with database views or query results.

Several Web frameworks make the relationship between a database and RESTful resources simple and explicit. Rails 1.2's ActiveResource framework can directly render database entities into RESTful resources. Restlet and Django make that task similarly easy with Java and Python, respectively.

Two ambitious projects are taking the Web-as-a-database approach to an even higher level by offering database-like features as a Web service. Both allow developers to create entire Web applications that treat those Web services as a database, and provide facilities to manipulate data via RESTful HTTP methods.

One such project is Google's Google Base and its associated API. The other Web-as-a-database project is Microsoft's Live platform and the related Project Astoria API, with goals similar to those of the Google Base API:

The goal of Microsoft ... Astoria 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.

A key aspect of both projects is the ability submit query-like statements to the services in order produce a desired view of a Web resource. In a recent blog post, Google Base Data API vs. Astoria: Two Approaches to SQL-like Queries in a RESTful Protocol, Dare Obasanjo compares the Google Base API and Astoria in terms of each framework's query capabilities:

Fundamentally URIs identify a single resource or asset of resources. On the other hand, SQL is primarily about dealing with relational data... A syntax for addressing single resources ... is fundamentally incompatible with a query language that operates over multiple resources. This was one of the primary reasons the W3C created XQuery even though we already had XPath.

That said, being able to perform sorting, filtering, and aggregate operations over a single set of resources via a URI is extremely useful and is a fundamental aspect of the Web today...

Both Google's Google Base data API and Microsoft's Project Astoria are RESTful protocols for performing sorting, filtering and aggregate operations similar to what you find in SQL over a hierarchical set of resources...

Obasanjo compares the two frameworks based on the following criteria:

  • Filtering results using predicates
  • Supported datatypes, operators and functions
  • Sorting
  • Paging

In conclusion, Obasanjo notes that:

There is a lot to like and dislike. I like the "expand" feature in Astoria as well as the fact that I can retrieve XML results from multiple paths of the hierarchy. However there does seem to be a paucity of operators and functions for better filtering of results.

From the Google Base data API, I love the "crowd" feature and having a full library of functions for performing tests within predicates. Also some of the operators such as the ones for finding results near a certain location are quite impressive although unnecessary for the majority of RESTful protocols out there. That said, I do think they went overboard on some of the features such as having if...else blocks within the URIs...

What do you think of the notion of considering RESTful Web services as a sort of database? And what's your take on the Google Base API and Astoria?

Topic: Lennart Ohman's Video Presentation on Erlang Previous Topic   Next Topic Topic: Refactoring Java Code with Scala and Eclipse

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use