In the latest episode of my Microsoft Conversations series I talked with Pablo Castro about Astoria, a layer of middleware that makes data readable and writeable by means of a RESTful interface. Even if you don’t know or care about the buzzwords, it’s easy to show what Astoria does and to explain why it’s interesting. One of the sample databases configured to work with the experimental version of Astoria is a subset of the Encarta encyclopedia. You don’t have be a programmer or grok XML in order to appreciate the following dialogue with the Astoria-enhanced version of Encarta.
|What are Encarta’s topic areas?||encarta/encarta.rse/Areas||
<Area uri="Areas"> <ID>4</ID> <Name>Life Sciences</Name> <Articles href="Areas/Articles" /> </Area> ...etc...
|The answer comes back in exactly the form shown here. It’s XML, but a very webby kind of XML that’s full of links that I’ve rendered as clickable.|
|So, what’s the fifth Area?||encarta/encarta.rse/Areas||
<Area uri="Areas"> <ID>5</ID> <Name>Sports, Hobbies, and Pets</Name> <Articles href="Areas/Articles"/> </Area>
|Every link asks a question, and gets an answer that embeds links to ask more questions.|
|OK, what are the articles in that area?||encarta/encarta.rse/Areas/Articles||
<Article uri="Articles"> <ID>761553558</ID> <Title>Aaron, Hank</Title> <Preview> Aaron, Hank, born in 1934, American baseball player, nicknamed Hammerin’ Hank, whose 755 home runs broke the all-time record previously held by ... </Preview> <Url> http://encarta.msn.com/encyclopedia_761553558/Hank_Aaron.html </Url> <Area href="Articles/Area"/> <ArticleBody href="Articles/ArticleBody"/> <Notes href="Articles/Notes"/> <RelatedArticles href="Articles/RelatedArticles"/> </Article> ...etc...
A database with Astoria layered on top of it isn’t a web application, but it’s within shouting distance of being one, and you don’t even have to shout very loudly.
I’m not even close to being an expert in the underlying data access technologies, including ADO.NET, the Entity Data Model, and LINQ, so parts of the discussion quite frankly went over my head. Nor am I yet familiar with the tooling that’s required to wrap this kind of services layer around a plain data source. But I’m 100% clear that it’s a good idea, and a great example of RESTful web services — a book that Pablo Castro says is “required reading” for members of the Astoria team.