<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>subbu.org</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/" />
    <link rel="self" type="application/atom+xml" href="http://www.subbu.org/atom.xml" />
    <id>tag:www.subbu.org,2007-07-18://1</id>
    <updated>2008-07-05T06:41:02Z</updated>
    <subtitle>Subbu Allamaraju&apos;s Blog</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Personal 4.1</generator>

<entry>
    <title>1000 Miles in Washington </title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/07/1000_miles_in_w.html" />
    <id>tag:www.subbu.org,2008://1.195</id>

    <published>2008-07-05T06:08:35Z</published>
    <updated>2008-07-05T06:41:02Z</updated>

    <summary type="html">With today&apos;s Cayuse Pass and Chinook Pass ride, I finished riding 1000 miles in exactly two months. This involved 32 rides, 56000ft of climb over 77 hours on the saddle (not exactly happy with the saddle time). Here is a screen shot from my ride diary at Cyclogz....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Cycling" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cycling" label="Cycling" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>With today's <a href="http://www.subbu.org/weblogs/main/2008/07/cayuse_pass_and.html">Cayuse Pass and Chinook Pass</a> ride, I finished riding 1000 miles in exactly two months. This involved 32 rides, 56000ft of climb over 77 hours on the saddle (not exactly happy with the saddle time). Here is a screen shot from my <a href="http://www.cyclogz.com/home/subbu">ride diary</a> at <a href="http://www.cyclogz.com">Cyclogz</a>.</p>]]>
        <![CDATA[<img src="/weblogs/main/2008/07/1000miles.png" alt="1000 Miles in Washington"/>

<p>Here are some of the most interesting rides done in this state so far.</p>

<p><a href="http://www.cyclogz.com/activity/471">Steven's Pass</a>: On May 31, 79 miles, 4972 ft climb. From Startup to the Steven's Pass and back, along Highway 2.</p>

<p><a href="http://www.cyclogz.com/activity/528">Blewett Pass</a>: On June 8, 54 miles, 2879 ft climb. From Cle Elum to the pass and back.</p>

<p><a href="http://www.cyclogz.com/activity/528">Cayuse Pass and Chinook Pass Pass</a>: On July 4, 64 miles, 4343 climb. From near Federation Park to the Chinook Pass and back, along route 410.</p>

<p><a href="http://www.cyclogz.com/activity/552">Flying Wheels Summer Century 2008</a>: On June 14, 101 miles, 4164 ft climb</p>

<p><a href="http://www.cyclogz.com/activity/455">Issaquah to Monroe</a>: On May 25, 66 miles, 2186 ft climb, mostly along route 203.</p>

<p><a href="http://www.cyclogz.com/activity/636">Mt Adams Country Bicycle Tour</a>: On June 28, 58 miles, 5300 ft climb, near Trout Lake.</p>

<p>So far, I like the quality of cycling here. There are a lots of hills, in fact, I can't get pure flat rides near where I live. There are few long climbs like the above. Rain does bother sometimes and I may need to invest in another rugged bike to ride on wet roads. On the plus side, I don't need to worry about too much heat.</p>
]]>
    </content>
</entry>

<entry>
    <title>Cayuse Pass and Chinook Pass Ride</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/07/cayuse_pass_and.html" />
    <id>tag:www.subbu.org,2008://1.194</id>

    <published>2008-07-05T03:27:59Z</published>
    <updated>2008-07-05T04:14:07Z</updated>

    <summary type="html">I needed to remind myself this morning that I should not stop getting out even if there is a 40% chance rain in the forecast. When I started from home this week, there was a slight and annoying drizzle, but I decided to ignore it and give it a try. It turned out to be great for most of the ride today....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Cycling" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cycling" label="Cycling" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>I needed to remind myself this morning that I should not stop getting out even if there is a 40% chance rain in the forecast. When I started from home this week, there was a slight and annoying drizzle, but I decided to ignore it and give it a try. It turned out to be great for most of the ride today.</p>]]>
        <![CDATA[<p>I found about Cayuse pass and Chinook pass along route 410 a couple of days ago as I was searching the list of mountain passes in the state of Washington. Since I moved here a couple of months ago, I already tried <a href="http://www.cyclogz.com/activity/471">Steven's Pass</a>, and <a href="http://www.cyclogz.com/activity/528">Blewett Pass</a>. I wanted to get some more miles before the STP next weekend. </p>

<p>Here is the ride profile from <a href="http://www.cyclogz.com/activity/663">Cyclogz</a>.</p>

<iframe src='http://www.cyclogz.com/activity/663/embed' width='80%' height='400' frameborder='0'></iframe>

<p>I started this ride about a mile before the <a href="http://www.parks.wa.gov/parkpage.asp?selectedpark=Federation+Forest">Federation State Park</a> along route 410. This is approximately 13 miles after leaving <a href="http://en.wikipedia.org/wiki/Enumclaw,_Washington">Enumclaw, WA</a>. When I started riding, there was a slight drizzle, but it faded away in a few miles. From here I rode along 410 all the way up to the intersection of routes 123 and 410. <a href="http://en.wikipedia.org/wiki/Cayuse_Pass">Cayuse Pass</a> is at this intersection, at approximately 4700ft. I then took a left and continued along 410 till the <a href="http://en.wikipedia.org/wiki/Chinook_Pass">Chinook Pass</a>, at approximately 5400ft.

<p>From the Federation State Park till about mile 21, the climb was very gradual - mostly under 4%. After crossing the Mt Rainier National Park, the climb got a bit steeper - ranging from 6-8%. Along the way, the views of Mt Rainer were fantastic.</a>

<p>The weather patterns along the route were very interesting. Up until 27 miles, it was cloudy to partially sunny. From then onwards it became very very foggy with poor visibility. I could barely see 50-100 ft ahead of me, and my green vest kept me visible. From there, the fog continued all the way to the Chinook Pass, with a couple of Sun breaks in the middle. For the last 3 miles, the fog was so intense that I did not have a sense of direction or the switchbacks that I did climb. The slow levels along the road also increased. There was enough snow to put on snowshoes on the side trails.</p>

<p>The decent was great, and I could manage a modest 35mph for the first few miles. The descent tapered off after about mile 42. From there I had to start pedaling again. For about 10 miles during the descent, I got caught up in rain again, this time it was more intense.</p>

<iframe align="center" src="http://www.flickr.com/slideShow/index.gne?group_id=&user_id=85765883@N00&set_id=72157605980938662&text=" frameBorder="0" width="500" height="500" scrolling="no"></iframe>

<p>Route 410 has wide-enough shoulder for biking. As far as water/food stops are concerned, Green River was the last place to buy things. There was a grocery store and a few coffee places in Green River. After that there were no stores along the way. There were a couple of resorts, which may have stores to buy water and energy food.</p>
]]>
    </content>
</entry>

<entry>
    <title>Obvious Choices</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/06/obvious_choices.html" />
    <id>tag:www.subbu.org,2008://1.193</id>

    <published>2008-06-18T19:33:36Z</published>
    <updated>2008-06-18T18:44:16Z</updated>

    <summary type="html"><![CDATA[One downside of working with experienced people is that, some experienced people tend to be opinionated, and the trouble with opinions is that opinions are, well, instantaneous reactions based on things they learned in the past. You can wake up an opinionated person and ask a question that you know this person has an opinion on, and that person (self included, on occasion) will most likely blurt out that opinion without even understanding the context. Unless careful, it is easy to get trapped into that mindset, and start enjoy being opinionated, and consequently, making or advocating &quot;obvious&quot; choices. Welcome to my soft rant!...]]></summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Software Engineering" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="architecture" label="Architecture" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="softwareengineering" label="Software Engineering" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>One downside of working with experienced people is that, some experienced people tend to be opinionated, and the trouble with opinions is that opinions are, well, instantaneous reactions based on things they learned in the past. You can wake up an opinionated person and ask a question that you know this person has an opinion on, and that person (self included, on occasion) will most likely blurt out that opinion without even understanding the context. Unless careful, it is easy to get trapped into that mindset, and start enjoy being opinionated, and consequently, making or advocating &quot;obvious&quot; choices. Welcome to my soft rant!</p>
]]>
        <![CDATA[<p>Here is one opinion heard several times on the blogosphere. If X says that he/she had performance issues with this new cool website, the &quot;opinionated&quot; would immediately ask, &quot;is that Rails based?&quot; and without even waiting for an answer, would offer his/her expert opinion that &quot;Rails is slow&quot; and that X should use Grails, PHP, or whatever that person is currently a fan of.</p>

<p>No offense to the commenter, but I received such a comment when I <a href="http://www.subbu.org/weblogs/main/2008/03/dreamhost_to_sl.html">blogged</a> that I had performance issues with DreamHost. I did not buy the comment that Rails is slow then, and I don't buy it now. There are other things that influence scalability and these vary from case to case.</p>

<p>Here is another example. In response to <a href="http://blog.doloreslabs.com/2008/06/facestat-scales/">FaceStat scales!</a>, the first commenter asks &quot;Why on earth didn't you use something like Grails that actually DOES scale?&quot;. I doubt if this commenter fully understands the architecture of FaceStat. To me, that is an automatic reaction, and so, I would be suspicious of that &quot;obvious&quot; choice that Grails or some other alternative would magically fix the scalability problems.</p>

<p>Say, for instance, if a PHP or a rails app is slow, an &quot;obvious&quot; choice is to throw memcache. But no amount of caching would rescue a poorly architected app. In fact, MySQL <a href="http://dev.mysql.com/tech-resources/articles/mysql-query-cache.html">query caching</a> may be sufficient for typical caching needs.</p>

<p>After writing the initial prototype of <a href="http://www.cyclogz.com">Cyclogz</a>, I wanted to check if there are similar sites, and if so, how they are approaching the problem. The problem was simple - retrieve a large amount of data from a GPS, and then extract lots of info from it for both presentation and analysis purposes. I came across two sites (one of which is <a href="http://www.motionbased.com">MotionBased<a>, owned by Garmin). Both these sites did what seemed like an &quot;obvious choice&quot;. Both sites upload all the data (in megabytes) to a server, store it in the database, and then kick off a background process to analyze and extract the data. This approach requires more hardware on the server side, more code to manage the background work, and more importantly, takes away instant gratification from the user. I won't describe alternatives here in detail, but better and more scalable design choices do exist. It was also fun thinking about the alternatives, and implementing those.</p>

<p>In the REST community, there is a similar pattern. Every now and then someone comes along with a need to do batch processing asserting that making &quot;n&quot; connections is slower than POSTing all requests in a single batch. When told of the problems with this approach, that person would immediately conclude that REST and/or HTTP is broken and that he/she &quot;needs&quot; to do batch processing.</p>

<p>So, if a choice seems too obvious to be incorrect, and is given by a smart but opinionated person, I say, take a step back, question and ponder. The obvious is not necessarily the best choice. The fun in writing software is figuring out those non-obvious choices. Repeating obvious choices is not fun.</p>]]>
    </content>
</entry>

<entry>
    <title>Steven&apos;s Pass Ride</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/06/stevens_pass_ri.html" />
    <id>tag:www.subbu.org,2008://1.192</id>

    <published>2008-06-03T03:31:54Z</published>
    <updated>2008-06-03T03:01:44Z</updated>

    <summary type="html">This weekend I rode up the Steven&apos;s Pass along Highway 2. This was a slow and long climb for about 40 miles from Startup (WA) to the pass. For up to 32 miles or so, the climb was so gradual that it just does not give much chance to recover. Worse yet, the descent on the way back does not feel like a descent at all. But the actual climb for the last 5 miles was excellent....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
    <category term="cycling" label="Cycling" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>This weekend I rode up the <a href="http://en.wikipedia.org/wiki/Stevens_Pass">Steven's Pass</a> along Highway 2. This was a slow and long climb for about 40 miles from Startup (WA) to the pass. For up to 32 miles or so, the climb was so gradual that it just does not give much chance to recover. Worse yet, the descent on the way back does not feel like a descent at all. But the actual climb for the last 5 miles was excellent.</p>
]]>
        <![CDATA[
<p>Here is the Cyclogz report.</p>

<iframe src='http://www.cyclogz.com/activity/471/embed' width='100%' height='400' frameborder='0'></iframe>]]>
    </content>
</entry>

<entry>
    <title>Busy Cycling Season</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/05/busy_cycling_se.html" />
    <id>tag:www.subbu.org,2008://1.190</id>

    <published>2008-05-20T04:50:34Z</published>
    <updated>2008-05-20T05:02:41Z</updated>

    <summary type="html">It is going to be a busy cycling season for me this year. After moving to WA nearly 10 days ago, I signed up for a membership in the Cacade Bicycling Club and several rides being organized by Cascade. The first one is the Flying Weels Summer Century on June 14. Then a month later, there is a double century from Seattle to Portland that I am planning to do in two days. Then there is the High Pass Challenge in September. I am trying to rope in Sanjay for the last one. And may be, may be, I can squeeze in Yaquina Wheels century in August. Let&apos;s see....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Cycling" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cycling" label="Cycling" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>It is going to be a busy cycling season for me this year. After moving to WA nearly 10 days ago, I signed up for a membership in the <a href="http://www.cascade.org">Cacade Bicycling Club</a> and several rides being organized by Cascade. The first one is the <a href="http://www.cascade.org/EandR/flying/index.cfm">Flying Weels Summer Century</a> on June 14. Then a month later, there is a double century from <a href="http://www.cascade.org/EandR/stp/index.cfm">Seattle to Portland</a> that I am planning to do in two days. Then there is the <a href="http://www.cascade.org/EandR/hpc/lodging.cfm">High Pass Challenge</a> in September. I am trying to rope in <a href="http://fastalgorithms.com">Sanjay</a> for the last one. And may be, may be, I can squeeze in <a href="http://www.yaquinawheels.org/Century.html">Yaquina Wheels</a> century in August. Let's see.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Avoid Versioning - Please</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/05/avoid_versionin.html" />
    <id>tag:www.subbu.org,2008://1.189</id>

    <published>2008-05-20T04:12:49Z</published>
    <updated>2008-05-20T04:37:43Z</updated>

    <summary type="html">Peter Williams recently made a good proposal suggesting content-negotiation as a means to advertise and ask for version support. This is in contrast to using version identifiers in URIs as is commonly done. This is a neat idea. Peter&apos;s post prompted some debate and a rebuttal. But I find that this debate is a distraction....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Software Engineering" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="versioning" label="Versioning" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Peter Williams recently made a <a href="http://pezra.barelyenough.org/blog/2008/05/versioning-rest-web-services/">good proposal</a> suggesting content-negotiation as a means to advertise and ask for version support. This is in contrast to using version identifiers in URIs as is commonly done. This is a neat idea. Peter's post prompted some <a href="http://www.ebpml.org/blog/89.htm">debate</a> and a <a href="http://pezra.barelyenough.org/blog/2008/05/resthttp-service-versioning-reponse-to-jean-jacques-dubray">rebuttal</a>. But I find that this debate is a distraction.</p>

]]>
        <![CDATA[<p>In my view, the real problems that every interface designer must be concerned about every day are (a) maintaining compatibility with the interface's clients, and (b) avoiding versioning.</p>

<p>Yes, avoiding versioning!</p>

<p>Versioning is a hack and is a clever disguise to hide the fact the interface has broken its contract with its clients, and needs clients to start all over again (i.e. upgrade to a newer version of the contract).</p>

<p>So, please please avoid versioning. I don't care how pretty one versioning solution is over another versioning solution, if it requires clients to change their code. If it does not require clients to change their code, the changes to the interface are, after all, compatible, and hence do not require a change in the version.</p>
]]>
    </content>
</entry>

<entry>
    <title>Hiatus</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/05/hiatus.html" />
    <id>tag:www.subbu.org,2008://1.188</id>

    <published>2008-05-19T02:25:05Z</published>
    <updated>2008-05-19T14:37:20Z</updated>

    <summary type="html">This blog has been silent for the last several weeks. We were busy moving from the bay area to WA, and getting settled into a new place of work and home. I still work from Yahoo!&apos;s web services team, but am now based in their Bellevue office. Quite a change from CA! So far, the changes have been positive and exciting both at work and outside work. What about the rain? I am not going to talk about it until we live here for at least one full year. Frankly, we have not experienced that much rain so far. Last two days have been quite warm, actually....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="misc" label="Misc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>This blog has been silent for the last several weeks. We were busy moving from the bay area to WA, and getting settled into a new place of work and home. I still work from Yahoo!'s web services team, but am now based in their Bellevue office. Quite a change from CA! So far, the changes have been positive and exciting both at work and outside work. What about the rain? I am not going to talk about it until we live here for at least one full year. Frankly, we have not experienced that much rain so far. Last two days have been quite warm, actually.</p>]]>
        
    </content>
</entry>

<entry>
    <title>More Acronyms</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/05/more_acronyms.html" />
    <id>tag:www.subbu.org,2008://1.187</id>

    <published>2008-05-19T02:09:20Z</published>
    <updated>2008-05-19T02:24:16Z</updated>

    <summary type="html">Pundits are redefining architecture yet again....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Pundits are <a href="http://blog.gartner.com/blog/index.php?itemid=400&catid=31#comments">redefining</a> architecture yet again.</p>

]]>
        <![CDATA[<div class="quote">
Web Oriented Architecture:

<ul>
<li>Long version: WOA is an architectural style that is a substyle of SOA based on the architecture of the WWW with the following additional constraints: globally linked, decentralized, and uniform intermediary processing of application state via self-describing messages</li>
<li>Shorthand version: WOA = SOA + WWW + REST</li>
</ul>
</div>

<p>Oh my! What!</p>

<p>Someone else <a href="http://tech.groups.yahoo.com/group/service-orientated-architecture/message/10273">clarifies</a> that:</p>

<div class="quote">
(WOA is) a core set of Web protocols like HTTP and plan (sic) XML to provide a simpler, and ... , more scalable, approach to Web Services.
</div>

<p>Okay - this sounds familiar. This is REST using HTTP as the uniform interface. Let the pundits worry about labeling old wine, and I bet they are going to confuse masses yet again.</p>
]]>
    </content>
</entry>

<entry>
    <title>Stop Using Ajax?</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/stop_using_ajax.html" />
    <id>tag:www.subbu.org,2008://1.186</id>

    <published>2008-04-26T04:16:44Z</published>
    <updated>2008-05-04T21:55:32Z</updated>

    <summary type="html">Here is a nice post at dev.opera.com. But I can&apos;t completely agree with the statement that the really good ideas in this evolution of the web are conceptual, not technological That&apos;s one side of the story. The other side is repeating the same ideas with better and more flexible technology....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Ajax" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ajax" label="Ajax" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Here is a <a href="http://dev.opera.com/articles/view/stop-using-ajax/">nice post</a> at <a href="http://dev.opera.com">dev.opera.com</a>. But I can't completely agree with the statement that </p>

<div class="quote">
the really good ideas in this evolution of the web are conceptual, not technological
</div>

<p>That's one side of the story. The other side is repeating the same ideas with better and more flexible technology.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Hypermedia Clients</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/hypermedia_clie.html" />
    <id>tag:www.subbu.org,2008://1.185</id>

    <published>2008-04-26T02:31:23Z</published>
    <updated>2008-04-26T03:08:51Z</updated>

    <summary type="html"><![CDATA[This is in response to Mike Amundsen's post on hypermedia. I started commenting on his blog, but then realized I have more to say than what I could fit in the comment form. Mike's questions are, for REST-ful applications that use JSON for representing resources, (a) &quot;where is the hypermedia (links and forms)&quot; and (b) &quot;what standardized clients understand how to render these elements propertly?&quot;...]]></summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>This is in response to Mike Amundsen's post on <a href="http://www.amundsen.com/blog/archives/762">hypermedia</a>. I started commenting on his blog, but then realized I have more to say than what I could fit in the comment form.</p>
		
<p>Mike's questions are, for REST-ful applications that use JSON for representing resources, (a) &quot;where is the hypermedia (links and forms)&quot; and (b) &quot;what standardized clients understand how to render these elements propertly?&quot;</p>

	]]>
        <![CDATA[<p>As far as machine clients are concerned, (X)HTML has the advantage of a set of universal clients, a browser being the most common one, that can fully take advantage of hypermedia. In addition, browsers can render representations as well as controls to search and modify resources. But that does not mean that the goal of REST's hypermedia constraint is to allow building such automated applications.</p>
	
<p>Assisted by the Atom Publishing Protocol, Atom Syndication Format has the advantage of a (smaller) set of generic clients that can deal with the hypermedia, but mostly in the blogging space. But when it comes to other applications of Atom and Atom Publishing Protocol, there are not any (at least to my knowledge) clients that can consume the hypermedia in a generic manner.</p>

<p>Take for example, OpenSocial, GData or Astoria where Atom feed/entry format is used to represent arbitrary resources like contacts, friends etc. In these cases, the purpose of the hypermedia is to take some <a href="http://www.subbu.org/weblogs/main/2008/04/opacity_of_uris.html">guesswork</a> out of client applications, and help client applications know how to fetch, create, modify or delete resources. For instance, client applications do not need to guess where to PUT to update a resource, or where to POST to create new resource. URIs for GET, POST, PUT and DELETE are expressed within representations of resources and collections of resources. This is hypermedia, as far as I understand it. </p>
	
<p>Now, similar information can be embedded in other media types as well, including <code>application/json</code>, if so desired. As far as the <a href="http://www.ietf.org/rfc/rfc5023">Atom Publishing Protocol</a> is concerned, isn't it just &quot;a&quot; profile of <a href="http://www.ietf.org/rfc/rfc2616">HTTP 1.1</a> using <a href="http://www.ietf.org/rfc/rfc4287">RFC 4287</a> for expressing representations of resources?</p>
	]]>
    </content>
</entry>

<entry>
    <title>Content Negotiation is not Broken</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/content_negotia.html" />
    <id>tag:www.subbu.org,2008://1.184</id>

    <published>2008-04-25T18:51:24Z</published>
    <updated>2008-04-25T19:28:36Z</updated>

    <summary type="html">Content negotiation in HTTP 1.1 is not broken. It is insufficient and incomplete, but the way it was defined in RFC 2616 works for what it is intended for. What is broken includes HTML, user agents, and buggy servers. Web services developers should not use the argument that content negotiation is broken and avoid supporting it altogether or support it poorly. I don&apos;t know if this was the rationale used by Twitter, but Twitter APIs do not understand content negotiation....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="HTTP" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Content negotiation in HTTP 1.1 is not broken. It is insufficient and incomplete, but the way it was defined in RFC 2616 works for what it is intended for. What is broken includes HTML, user agents, and buggy servers. Web services developers should not use the argument that content negotiation is broken and avoid supporting it altogether or support it poorly. I don't know if this was the rationale used by Twitter, but <a href="http://groups.google.com/group/twitter-development-talk/web/api-documentation">Twitter APIs</a> do not understand content negotiation.</p>
]]>
        <![CDATA[<p>For example, take the following GET request (edited for brevity).</p> 

<pre name="code" language="http">
&gt; GET /statuses/friends.json HTTP/1.1
&gt; Host: twitter.com
&gt; Accept: application/xml
&gt; 
&lt; HTTP/1.1 200 OK
&lt; Date: Fri, 25 Apr 2008 17:06:39 GMT
&lt; Status: 200 OK
&lt; Content-Type: application/json; charset=utf-8
&lt; Content-Length: 2
&lt; Connection: close
&lt; 
* Closing connection #0
[...]		
</pre>

<p>The response I get back is always of type <code>application/json</code> no matter what <code>Accept</code> header I send. What determines the response content type is the string that follows the dot in the last path segment of the request URI. That is, Twitter's representations are not negotiable in the HTTP 1.1 sense. The client needs to rely on Twitter's documentation to know that <code>.xml</code> at the end of the URI implies  that client is asking for <code>application/xml</code> and not, let's say, <code>application/atom+xml</code> or <code>application/json</code>. This style of URI-based negotiation will break automated client applications that understand HTTP 1.1. Another problem with this approach is that, it forces the API to come up with new extensions for URIs for new media types, like <code>.text</code>, <code>.svg</code> and so on.</p>

<p>To be clear, content-negotiation in HTTP 1.1 is not complete. For instance, there is no way for a server to indicate what kind of media types it can represent a given resource in. That is, by purely relying on HTTP 1.1, a client can not discover the media types. HTML and Atom fix this via the <code>link</code> tag.</p>

<p>Most of the frustration with content negotiation is rooted in HTML. While you can indicate that alternative representations are available via the <code>link</code> tag for machine consumption (e.g. a blog reader to discover an Atom feed representation of my blog), you can not encode this information into <code>a</code> tags. That is, the following is not possible.</p>

<pre name="code" language="html">
	&lt;a href="URI to a resource" rel="alternate" types="application/atom+xml,application/json,text/html"/&gt;
</pre>

<p>This forces multiple representations to be explicitly encoded into HTML each with a distinct URI.</p>

<pre name="code" language="html">
	&lt;a href="/foo.html"&gt;HTML&lt;/a&gt;
	&lt;a href="/foo.atom"&gt;Atom feed&lt;/a&gt;
	&lt;a href="/foo.atom"&gt;JSON&lt;/a&gt;
</pre>

<p>See <a href="http://www.w3.org/2001/tag/doc/alternatives-discovery.html">On Linking Alternative Representations To Enable Discovery And Publishing </a> for more relevant discussion. As Dare Obasanjo once <a href="http://www.25hoursaday.com/weblog/2006/04/12/BrokenAsDesignedHTTPContentNegotiationRemix.aspx">argued</a>, &quot;content negotiation has failed to take hold on the web&quot;. But that does not justify the Twitter example above. APIs like that of Twitter are mainly for machine consumption, and should implement content negotiation. A <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=192218">post</a> by Frank Sommers at <a href="http://www.artima.com">Artima</a> tries to justify separate URIs for each media type so as to keep the server-side code simple, but I would argue that simplicity in server-side code can still be achieved. It just takes a little more design and discipline.</p>]]>
    </content>
</entry>

<entry>
    <title>Hypermedia and JSON?</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/hypermedia_and.html" />
    <id>tag:www.subbu.org,2008://1.183</id>

    <published>2008-04-25T15:16:02Z</published>
    <updated>2008-04-25T15:37:29Z</updated>

    <summary type="html"><![CDATA[Mike Amundsen is wondering how to express hypermedia in JSON. He rightly identifies that there needs to be a new media type, e.g. application/hypermedia+json. Putting together such a new media type is not hard, but in my view, the real issue is defining a JSON format that can express data/media as well as hypermedia. One possibility is to take the &quot;payload&quot; formats defined by Atom and Atom Publishing Protocol, and translate that into JSON using some simple rules. Here is one, based on example from RFC 5023....]]></summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Mike Amundsen is wondering how to express <a href="http://www.amundsen.com/blog/archives/757">hypermedia in JSON</a>. He rightly identifies that there needs to be a new media type, e.g. <code>application/hypermedia+json</code>. Putting together such a new media type is not hard, but in my view, the real issue is defining a JSON format that can express data/media as well as hypermedia. One possibility is to take the &quot;payload&quot; formats defined by Atom and Atom Publishing Protocol, and translate that into JSON using some simple rules. Here is one, based on example from RFC 5023.</p>
]]>
        <![CDATA[
<pre name="code" class="javascript">
{
  "entry" : {
    "title" : Atom-Powered Robots Run Amok",
    "id" : "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a",
    "updated" : "2003-12-13T18:30:02Z",
    "author" : {
      "name" : "John Doe"
     },
    "content": "Some text.",
    "link" : {
      "rel" : "edit",
      "href" : "http://example.org/edit/first-post.atom"
    }
}
</pre>

]]>
    </content>
</entry>

<entry>
    <title>Mt Hamilton Ride</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/mt_hamilton_rid.html" />
    <id>tag:www.subbu.org,2008://1.182</id>

    <published>2008-04-20T04:24:46Z</published>
    <updated>2008-04-20T04:43:30Z</updated>

    <summary type="html">With the weather being a bit cooler than it was last week, I decided to ride up Mt Hamilton today, from east to west, starting from Livermore. From downtown Livermore, it is a about 49 miles to the summit (at about 4300 ft), which makes it tougher to climb from this side. What is more challenging is that, the final climb of about 2000ft happens in just about six miles (i.e. from mile 43). These six miles are grueling, with an average 9-10% grade, and I could not average more than 4 miles/hour during this segment. My GPS puts the cumulative ascent at 6500ft, although my legs are trying to make me believe that it is much more than that....</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="Cycling" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cycling" label="Cycling" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>With the weather being a bit cooler than it was last week, I decided to ride up <a href="http://en.wikipedia.org/wiki/Mt_hamilton">Mt Hamilton</a> today, from east to west, starting from <a href="http://en.wikipedia.org/wiki/Livermore%2C_California">Livermore</a>. From downtown Livermore, it is a about 49 miles to the summit (at about 4300 ft), which makes it tougher to climb from this side. What is more challenging is that, the final climb of about 2000ft happens in just about six miles (i.e. from mile 43). These six miles are grueling, with an average 9-10% grade, and I could not average more than  4 miles/hour during this segment. My GPS puts the cumulative ascent at 6500ft, although my legs are trying to make me believe that it is much more than that.</p>]]>
        <![CDATA[<p>Here are the ride details from <a href="http://www.cyclogz.com">Cyclogz.com</a>.</p>

<iframe src='http://www.cyclogz.com/activity/376/embed' width='100%' height='400' frameborder='0'></iframe>

<p>And, here are some pictures I took along the way.</p>

<script type="text/javascript" language="javascript" src="http://v3.flickrshow.com/js/with/"></script>
<script type="text/javascript">
fs1 = new flickrShow("72157604633084011", "fsDemo", "grey");
</script>
<div id="fsDemo" style="position:relative; width: 500px; height:300px;">
<p>A slide show will appear here shortly.</p>
</div>]]>
    </content>
</entry>

<entry>
    <title>ServiceReg - What&apos;s the Goal?</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/servicereg_what.html" />
    <id>tag:www.subbu.org,2008://1.181</id>

    <published>2008-04-11T16:40:15Z</published>
    <updated>2008-04-11T16:43:27Z</updated>

    <summary type="html"><![CDATA[Through Stefan Tilkov's blog, I came across ServiceReg whose goal is to let us &quot;execute RESTful web service calls against Rails applications (and other REST compliant framworks) with a simple URL&quot;. The &quot;simple URL&quot; is one that can be submitted via a GET....]]></summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>Through <a href="http://www.innoq.com/blog/st/">Stefan Tilkov</a>'s blog, I came across <a href="http://www.servicereg.com/">ServiceReg</a> whose goal is to let us &quot;execute RESTful web service calls against Rails applications (and other REST compliant framworks) with a simple URL&quot;. The &quot;simple URL&quot; is one that can be submitted via a GET. </p>]]>
        <![CDATA[
<p>If I have a resource at <code>http://www.subbu.org/vide/1234</code> that can be updated via a PUT, ServiceReg will turn that into a GET:</p>

<pre>
http://servicereg.com/put/subbu.org/video/1234?title=Hello
</pre>

<p>This is bizarre. Why proxy POST, PUT and DELETE via a GET? As Stefan pointed out, this violates the purpose of RESTful design. But there is more to it. It masquerades all write operations as read operations, and that could lead to unintended consequences.</p>

<p>The motivation of ServiceReg may be to let GETs be used to replace other verbs so that URLs can be bookmarked. But still - it does not make sense.</p>  ]]>
    </content>
</entry>

<entry>
    <title>Opacity of URIs</title>
    <link rel="alternate" type="text/html" href="http://www.subbu.org/weblogs/main/2008/04/opacity_of_uris.html" />
    <id>tag:www.subbu.org,2008://1.180</id>

    <published>2008-04-10T04:24:24Z</published>
    <updated>2008-04-10T04:43:28Z</updated>

    <summary type="html">When it comes to URI design, I am in the camp that argues that URIs ought to be opaque as far as the representations are concerned. In my view, URIs and representations are two independent axes of web service design, and must be designed to be evolved independently of each other, and that URIs should not be used to infer the structure of representations. Does this mean that URIs should be completely opaque and cryptic, like the following ......</summary>
    <author>
        <name>Subbu Allamaraju</name>
        <uri>http://www.subbu.org</uri>
    </author>
    
        <category term="REST" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rest" label="REST" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.subbu.org/">
        <![CDATA[<p>When it comes to URI design, I am in the camp that argues that URIs ought to be opaque as far as the representations are concerned. In my view, URIs and representations are two independent axes of web service design, and must be designed to be evolved independently of each other, and that URIs should not be used to <a href="http://www.subbu.org/weblogs/main/2008/04/uris_and_object.html">infer the structure</a> of representations. Does this mean that URIs should be completely opaque and cryptic, like the following ...</p>]]>
        <![CDATA[<pre>
http://accessories.us.dell.com/sna/products/Windows_Mobile_PDAs/productdetail.aspx?c=us&l=en&s=biz&cs=555&sku=A1153537
</pre>

<p>No. It should be possible to guess or interpret the nature of the resource by looking at a URI. That is, URIs are opaque to a machine dealing with the web service (unless otherwise described through a specification of the URI), but transparent to the user, like the following:</p>

<pre>
http://www.cnn.com/2008/POLITICS/04/09/clinton.iraq/index.html
</pre>

<p>An old W3C note on <a href="http://www.w3.org/2001/tag/doc/metaDataInURI-31.html">The use of metadata in URIs</a>, describes the principles very well. </p>

<p>A related issue is resources carrying references to other resources. Consider, for example, my profile on a social networking site referring to pool of pictures uploaded by me? One common pattern is the following:</p>

<pre class="code" language="xml">
&lt;photos page="2" pages="89" perpage="10" total="881"&gt;
  &lt;photo id="2636" owner="47058503995@N01" 
    secret="a123456" server="2" title="test_04"
    ispublic="1" isfriend="0" isfamily="0" /&gt;
  &lt;photo id="2635" owner="47058503995@N01"
    secret="b123456" server="2" title="test_03"
    ispublic="0" isfriend="1" isfamily="1" /&gt;
  &lt;photo id="2633" owner="47058503995@N01"
    secret="c123456" server="2" title="test_01"
    ispublic="1" isfriend="0" isfamily="0" /&gt;
  &lt;photo id="2610" owner="12037949754@N01"
    secret="d123456" server="2" title="00_tall"
    ispublic="1" isfriend="0" isfamily="0" /&gt;
&lt;/photos&gt;
</pre>

<p>This is used by Flickr's <a href="http://www.flickr.com/services/api/flickr.photos.getRecent.html">photos.getRecent</a> API. In this model, the photos element is a collection of photo elements each referred to by two IDs, viz, an ID for the owner, and another ID for the photo.</p>

<p>To GET each of photo from this collection, the client will have to refer to another part of Flickr API <a href="http://www.flickr.com/services/api/misc.urls.html">documentation</a> to learn how to construct a URI. </p>

<p>This is an exception to the opacity rule. Here the web service specified how to construct URIs, and so a machine client could construct URIs programmatically.</p>

<p>Still, this is no match for the following:</p>

<pre class="code" language="xml">
&lt;photos page="2" pages="89" perpage="10" total="881">
  &lt;photo uri="http://farm2.static.flickr.com/2/2636_a123456.jpg"     
    owner="http://www.flickr.com/photos/name1"
    title="test_04" ispublic="1" isfriend="0" isfamily="0" /&gt;
  &lt;photo uri="http://farm2.static.flickr.com/2/2635_b123456.jpg"      
    owner="http://www.flickr.com/photos/name1"
    title="test_03" ispublic="0" isfriend="1" isfamily="0" /&gt;
  &lt;photo uri="http://farm2.static.flickr.com/2/2636_c123456.jpg"        
    owner="http://www.flickr.com/photos/name1" 
    title="test_01" ispublic="1" isfriend="0" isfamily="0" /&gt;
  &lt;photo uri="http://farm2.static.flickr.com/2/2636_d123456.jpg"         
    owner="http://www.flickr.com/photos/name1"
    title="00_tall" ispublic="1" isfriend="0" isfamily="0" /&gt;
&lt;/photos&gt;
</pre>

<p>where the URI is explicitly provided as part of the representation so that a machine client would immediately know to fetch the resource without manufacturing URIs. If a web service is providing IDs to resources only to let the client be able to construct a URI, it is better to provide the URI in stead of IDs.</p>

<p>How about <a href="http://www.ietf.org/internet-drafts/draft-gregorio-uritemplate-03.txt">URI Templates</a>? URI templates serve a useful purpose by letting opaque URIs be programmable. But they should not be used to avoid serving URIs, as above.</p>]]>
    </content>
</entry>

</feed>
