XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.


Dreaming of an Atom Store: A Database for the Web

Dreaming of an Atom Store: A Database for the Web

September 21, 2005

After a year of work -- two if you count the work done before the AtomPub WG was formed -- the Atom Publishing Protocol (APP) is moving closer to being done. There are still parts that are unspecified, and other parts of the protocol are under debate even now. Even given that, some of the protocol is very stable, unchanged from even the earliest drafts. Despite the incomplete nature of the APP, there are plenty of people that are excited about it and are beginning to imagine all sorts of uses for it beyond a weblog publishing API, which was its original target. Over the course of the last couple months several of those ideas have collided often enough that we're starting to see a stable fusion. The ideas that are colliding are the APP and Amazon's OpenSearch. Let's take a moment for a quick recap:

Atom Publishing Protocol

The Atom Publishing Protocol leverages the work done on the Atom Syndication Format and the basics of HTTP to form a simple, yet powerful, publishing protocol. One of the things that doesn't get noticed at first about the Atom Syndication Format is that not only are feeds first class documents, but so are entries. This, for example, is a valid Atom document:

<entry xmlns="http://www.w3.org/2005/Atom">
    <title>Atom draft-07 snapshot</title>
    <link rel="alternate" type="text/html" 
    <link rel="enclosure" type="audio/mpeg" length="1337"
      <name>Mark Pilgrim</name>
      <name>Sam Ruby</name>
      <name>Joe Gregorio</name>
    <content type="xhtml" xml:lang="en" 
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><i>[Update: The Atom draft is finished.]</i></p>

The Atom Publishing Protocol is all about pushing around Atom Entries. For now, we'll assume that the APP is just used for editing a weblog, and that a weblog is made up of entries. Note that is a small "e" entry. For each small "e" entry there is a big "E" Entry that represents it. Each of those big "E" Entries lives at its own URI. Each entry in your weblog has a corresponding URI for the Atom Entry that represents it. Do an HTTP GET on that URI to get the Entry; PUT a new Entry to the URI to update the Entry and the corresponding small "e" entry gets updated too. HTTP DELETE on that URI and the small "e" entry is deleted. The Entries that are used to represent the entries in the weblog are grouped together in a Collection. That, too, is a resource and has its own URI. To add a new entry to your weblog you POST an Entry to the Collection, which in turn creates the small "e" entry.

Open Search

Amazon's A9 service launched two years ago to research and build innovative technologies to improve the search experience for e-commerce applications. One of those technologies is OpenSearch, a CC-licensed specification for search using Atom and RSS. In other words, OpenSearch defines a RESTful web service for searching, including a format for advertising what kind of search your site supports, and specifying how to return your search results in Atom or RSS.

Two Great Tastes That Taste Great Together

Now it's these two ideas, the APP and OpenSearch, that have started to show up together. Imagine enhancing the APP method of editing your weblog with OpenSearch. You could search across all your entries and find the right ones you want to edit or delete. You already have the capability to return an Atom Entry for each entry on your site if you implement the APP, so returning a bunch of them in the form of a feed in response to an OpenSearch request isn't such a great leap.

Here is where the idea itself starts to break loose from its beginnings and take on a life of its own. Imagine that there isn't a weblog associated with all those entries. Imagine that you just have a huge glob of storage that you can store Atom Entries in, and which you can edit using the APP, and then search over using OpenSearch. That idea, that big blob of Atom Entries, all editable and searchable, is an Atom Store.

Pages: 1, 2

Next Pagearrow