<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Accessing RESTful information efficiently</title>
	<atom:link href="http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently</link>
	<description>by Gustavo Niemeyer</description>
	<lastBuildDate>Mon, 16 Jan 2012 12:12:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Steve Alexander</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68725</link>
		<dc:creator>Steve Alexander</dc:creator>
		<pubDate>Tue, 11 Aug 2009 10:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68725</guid>
		<description>What&#039;s the point of using a REST architectural style?

Roy Fielding writes:
&quot;REST is an architectural style that, when followed, allows components to carry out their functions in a way that maximizes the most important architectural properties of a multi-organizational, network-based information system. In particular, it maximizes the growth of identified information within that system, which increases the utility of the system as a whole.&quot;

http://roy.gbiv.com/untangled/2008/on-software-architecture

Here&#039;s how I apply this to your example.  You already decided that you don&#039;t want to make the list of 200 books into a piece of &quot;identified information&quot;.  This list exists only on the client.  So, there is no benefit in applying the REST architectural style to this part of the overall &quot;information system about books&quot; problem.

It&#039;s great that a book is individually addressable for CRUD operations (that is, each book has become &quot;identified information&quot;).

But, unless the list of 200 books that the client is interested in becomes a piece of identified information, this part of the system is just part of the client, not part of the web.  So, if the regular REST API of the server is insufficient for the client, because it is too inefficient for your overall design, it makes sense to have a specific operation between client and server to support this feature of the client.  Nothing has been lost by having the operation fall outside of the REST architectural style, because the information it is the &quot;subject&quot; of the interaction is not identified information on the web.</description>
		<content:encoded><![CDATA[<p>What&#8217;s the point of using a REST architectural style?</p>
<p>Roy Fielding writes:<br />
&#8220;REST is an architectural style that, when followed, allows components to carry out their functions in a way that maximizes the most important architectural properties of a multi-organizational, network-based information system. In particular, it maximizes the growth of identified information within that system, which increases the utility of the system as a whole.&#8221;</p>
<p><a href="http://roy.gbiv.com/untangled/2008/on-software-architecture" rel="nofollow">http://roy.gbiv.com/untangled/2008/on-software-architecture</a></p>
<p>Here&#8217;s how I apply this to your example.  You already decided that you don&#8217;t want to make the list of 200 books into a piece of &#8220;identified information&#8221;.  This list exists only on the client.  So, there is no benefit in applying the REST architectural style to this part of the overall &#8220;information system about books&#8221; problem.</p>
<p>It&#8217;s great that a book is individually addressable for CRUD operations (that is, each book has become &#8220;identified information&#8221;).</p>
<p>But, unless the list of 200 books that the client is interested in becomes a piece of identified information, this part of the system is just part of the client, not part of the web.  So, if the regular REST API of the server is insufficient for the client, because it is too inefficient for your overall design, it makes sense to have a specific operation between client and server to support this feature of the client.  Nothing has been lost by having the operation fall outside of the REST architectural style, because the information it is the &#8220;subject&#8221; of the interaction is not identified information on the web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Morrissey</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68473</link>
		<dc:creator>John Morrissey</dc:creator>
		<pubDate>Thu, 30 Jul 2009 16:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68473</guid>
		<description>I&#039;ve implemented Ian Bicking&#039;s multipart MIME idea (http://blog.ianbicking.org/restful-transactions.html) in a couple of cases.

It breaks some RESTful principles (proxying, most notably), but each MIME part amounts to a separate HTTP request that can be replayed into the same handlers that would be triggered by that request when submitted &quot;normally.&quot;

It&#039;s also nice since you don&#039;t need to keep a cross-request transaction open when you want to make multiple updates transactionally.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve implemented Ian Bicking&#8217;s multipart MIME idea (<a href="http://blog.ianbicking.org/restful-transactions.html" rel="nofollow">http://blog.ianbicking.org/restful-transactions.html</a>) in a couple of cases.</p>
<p>It breaks some RESTful principles (proxying, most notably), but each MIME part amounts to a separate HTTP request that can be replayed into the same handlers that would be triggered by that request when submitted &#8220;normally.&#8221;</p>
<p>It&#8217;s also nice since you don&#8217;t need to keep a cross-request transaction open when you want to make multiple updates transactionally.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Burrows (@asplake)</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68431</link>
		<dc:creator>Mike Burrows (@asplake)</dc:creator>
		<pubDate>Tue, 28 Jul 2009 20:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68431</guid>
		<description>Gustavo, you&#039;re right - on too a quick reading I recognized the search requirement (and search does generalize quite nicely) but in my haste overlooked the problem that there are hard limits to what can be coded in a URI.

To be honest, I think a big POST is fine in your example, since at the time your first request is made the server has no concept at all of the local &quot;resource&quot;.  Afterwards though, there&#039;s nothing then preventing the server from maintaining a version of the of it as an identifiable resource on the web that could support further interaction.</description>
		<content:encoded><![CDATA[<p>Gustavo, you&#8217;re right &#8211; on too a quick reading I recognized the search requirement (and search does generalize quite nicely) but in my haste overlooked the problem that there are hard limits to what can be coded in a URI.</p>
<p>To be honest, I think a big POST is fine in your example, since at the time your first request is made the server has no concept at all of the local &#8220;resource&#8221;.  Afterwards though, there&#8217;s nothing then preventing the server from maintaining a version of the of it as an identifiable resource on the web that could support further interaction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Niemeyer</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68430</link>
		<dc:creator>Gustavo Niemeyer</dc:creator>
		<pubDate>Tue, 28 Jul 2009 19:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68430</guid>
		<description>Sorry, I guess I misunderstood what your actual suggestion was.

What you describe is the same I mentioned in the blog post I guess:

&lt;blockquote&gt;I can imagine some workarounds for this, like saving a temporary list of books with PUT, and then doing the query on that temporary list’s URI&lt;/blockquote&gt;

I probably wasn&#039;t clear, since that was brought up by Leonardo too.</description>
		<content:encoded><![CDATA[<p>Sorry, I guess I misunderstood what your actual suggestion was.</p>
<p>What you describe is the same I mentioned in the blog post I guess:</p>
<blockquote><p>I can imagine some workarounds for this, like saving a temporary list of books with PUT, and then doing the query on that temporary list’s URI</p></blockquote>
<p>I probably wasn&#8217;t clear, since that was brought up by Leonardo too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68429</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Tue, 28 Jul 2009 19:21:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68429</guid>
		<description>&lt;blockquote&gt;You certainly can, but that’s what’s referred to as the RPC-style, because you’re doing a remote call to the final web server and expecting an answer to your specific query which has to be computed.&lt;/blockquote&gt;

Well RPC style primarily differentiates itself by a profusion of verbs - thats not what we are seeing here. If variable optional arguments is RPC style then any pagination implementation that is otherwise ReSTful should be treated as RPC style. So I would not jump so far as to say it is RPC style. However I would admit that that was not the most satisfactory solution (which is why I went ahead with offering two more refinements on the same). 

&lt;blockquote&gt;All of the RESTful properties are gone in this case, because there’s no layering, caching, etc.&lt;/blockquote&gt;

If you review the final solution I suggested you will find that all the ReSTful properties are still available. You are responding to only the intermediate solution I discuss in a conversational style. 

And yes, I did review the book and the resources referred to, many times over ;) In fact while not on the same specific issue, I did offer a whole bunch of opinions on ReST here http://blog.dhananjaynene.com/2009/06/musings-on-rest/ and here : http://blog.dhananjaynene.com/2009/07/presentation-rest-explained/</description>
		<content:encoded><![CDATA[<blockquote><p>You certainly can, but that’s what’s referred to as the RPC-style, because you’re doing a remote call to the final web server and expecting an answer to your specific query which has to be computed.</p></blockquote>
<p>Well RPC style primarily differentiates itself by a profusion of verbs &#8211; thats not what we are seeing here. If variable optional arguments is RPC style then any pagination implementation that is otherwise ReSTful should be treated as RPC style. So I would not jump so far as to say it is RPC style. However I would admit that that was not the most satisfactory solution (which is why I went ahead with offering two more refinements on the same). </p>
<blockquote><p>All of the RESTful properties are gone in this case, because there’s no layering, caching, etc.</p></blockquote>
<p>If you review the final solution I suggested you will find that all the ReSTful properties are still available. You are responding to only the intermediate solution I discuss in a conversational style. </p>
<p>And yes, I did review the book and the resources referred to, many times over <img src='http://blog.labix.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  In fact while not on the same specific issue, I did offer a whole bunch of opinions on ReST here <a href="http://blog.dhananjaynene.com/2009/06/musings-on-rest/" rel="nofollow">http://blog.dhananjaynene.com/2009/06/musings-on-rest/</a> and here : <a href="http://blog.dhananjaynene.com/2009/07/presentation-rest-explained/" rel="nofollow">http://blog.dhananjaynene.com/2009/07/presentation-rest-explained/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Niemeyer</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68428</link>
		<dc:creator>Gustavo Niemeyer</dc:creator>
		<pubDate>Tue, 28 Jul 2009 18:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68428</guid>
		<description>&lt;blockquote&gt;If thats kosher for ReST would it be OK to pass the parameters as a part of POST instead of GET ?&lt;/blockquote&gt;

You certainly can, but that&#039;s what&#039;s referred to as the RPC-style, because you&#039;re doing a remote call to the final web server and expecting an answer to your specific query which has to be computed.  All of the RESTful properties are gone in this case, because there&#039;s no layering, caching, etc.

Please check out the book or some of the resources Leonardo Boiko suggested above for a more in-depth description of the reasoning behind the REST-style.</description>
		<content:encoded><![CDATA[<blockquote><p>If thats kosher for ReST would it be OK to pass the parameters as a part of POST instead of GET ?</p></blockquote>
<p>You certainly can, but that&#8217;s what&#8217;s referred to as the RPC-style, because you&#8217;re doing a remote call to the final web server and expecting an answer to your specific query which has to be computed.  All of the RESTful properties are gone in this case, because there&#8217;s no layering, caching, etc.</p>
<p>Please check out the book or some of the resources Leonardo Boiko suggested above for a more in-depth description of the reasoning behind the REST-style.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68426</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Tue, 28 Jul 2009 18:32:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68426</guid>
		<description>I still get confused by put and post :) Meant a POST instead of PUT in the comment above.</description>
		<content:encoded><![CDATA[<p>I still get confused by put and post <img src='http://blog.labix.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Meant a POST instead of PUT in the comment above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68425</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Tue, 28 Jul 2009 18:30:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68425</guid>
		<description>Gustavo,

It is not unacceptable to have optional scoping parameters being passed as a part of the URL (eg. for pagination). If thats kosher for ReST would it be OK to pass the parameters as a part of POST instead of GET ?

Now maybe that breaks the URI notion of ReST. But what if I remodeled the functionality differently (I&#039;m just thinking aloud). What if I PUT a &quot;Query&quot; resource and the response is a List of Books feed ? Is that acceptable ? Maybe and maybe not. Let us go with the latter. Now, I can PUT a Query resource which has a list of older URIs - the response returns me a QueryID. Note that the Query is not a typical query but is a collection of URIs. Could I now do a GET on a BookSet resource using that QueryID ? Perhaps. I could even extend it further by allowing to append more URIs by doing a POST using the earlier obtained QueryID. (Note that the QueryID could interchangeably be also referred to as a BookSetID - just depends upon which way one wants to view it). Now one gets good batching as well.

That seems to work for me.

Cheers.</description>
		<content:encoded><![CDATA[<p>Gustavo,</p>
<p>It is not unacceptable to have optional scoping parameters being passed as a part of the URL (eg. for pagination). If thats kosher for ReST would it be OK to pass the parameters as a part of POST instead of GET ?</p>
<p>Now maybe that breaks the URI notion of ReST. But what if I remodeled the functionality differently (I&#8217;m just thinking aloud). What if I PUT a &#8220;Query&#8221; resource and the response is a List of Books feed ? Is that acceptable ? Maybe and maybe not. Let us go with the latter. Now, I can PUT a Query resource which has a list of older URIs &#8211; the response returns me a QueryID. Note that the Query is not a typical query but is a collection of URIs. Could I now do a GET on a BookSet resource using that QueryID ? Perhaps. I could even extend it further by allowing to append more URIs by doing a POST using the earlier obtained QueryID. (Note that the QueryID could interchangeably be also referred to as a BookSetID &#8211; just depends upon which way one wants to view it). Now one gets good batching as well.</p>
<p>That seems to work for me.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Niemeyer</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68424</link>
		<dc:creator>Gustavo Niemeyer</dc:creator>
		<pubDate>Tue, 28 Jul 2009 17:57:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68424</guid>
		<description>Mike,

It&#039;s an interesting idea, but it&#039;s not clear to me how that would help with the issue above, perhaps due to my lack of understanding of what URI templates will bring in addition to the templating itself.

Dhananjay,

It is a possibility, but one of the issues with this approach is that there are arbitrary and not-well established limits to how long a URI can be.  There&#039;s even an error code (413) which is used when the URI is too long.

I guess a possibility would be to ensure clients implement proper batching of the requests, on a trial and error basis.  Not so great, but could work.

&lt;b&gt;Update:&lt;/b&gt; hmm.. on a second thought, I fail to see how that would be an advantage over usual RPC over HTTP.  The arbitrary way in which URIs would be built would kill most of the benefits of REST-styled architectures.</description>
		<content:encoded><![CDATA[<p>Mike,</p>
<p>It&#8217;s an interesting idea, but it&#8217;s not clear to me how that would help with the issue above, perhaps due to my lack of understanding of what URI templates will bring in addition to the templating itself.</p>
<p>Dhananjay,</p>
<p>It is a possibility, but one of the issues with this approach is that there are arbitrary and not-well established limits to how long a URI can be.  There&#8217;s even an error code (413) which is used when the URI is too long.</p>
<p>I guess a possibility would be to ensure clients implement proper batching of the requests, on a trial and error basis.  Not so great, but could work.</p>
<p><b>Update:</b> hmm.. on a second thought, I fail to see how that would be an advantage over usual RPC over HTTP.  The arbitrary way in which URIs would be built would kill most of the benefits of REST-styled architectures.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dhananjay Nene</title>
		<link>http://blog.labix.org/2009/07/23/accessing-restful-information-efficiently/comment-page-1#comment-68419</link>
		<dc:creator>Dhananjay Nene</dc:creator>
		<pubDate>Tue, 28 Jul 2009 15:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.labix.org/?p=142#comment-68419</guid>
		<description>Actually why can we not treat this as a finder with OR (just like google search terms ) ? Seems like a straightforward solution to me. I mean 200 URIs separated by an OR or equivalent clause is a large data but not really that large. Or is it ?</description>
		<content:encoded><![CDATA[<p>Actually why can we not treat this as a finder with OR (just like google search terms ) ? Seems like a straightforward solution to me. I mean 200 URIs separated by an OR or equivalent clause is a large data but not really that large. Or is it ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

