<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Brian Olore Story &#187; api</title>
	<atom:link href="http://brian.olore.net/wp/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://brian.olore.net</link>
	<description>Less of a story, more of a brain dump</description>
	<lastBuildDate>Sun, 18 Dec 2011 17:19:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RailsConf &#8211; Day 2 &#8211; Building an API with Rails panel</title>
		<link>http://brian.olore.net/wp/2010/06/railsconf-day-2-api/</link>
		<comments>http://brian.olore.net/wp/2010/06/railsconf-day-2-api/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:42:50 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[railsconf]]></category>

		<guid isPermaLink="false">http://brian.olore.net/?p=151</guid>
		<description><![CDATA[Building an API with Rails Panel  &#8211; http://en.oreilly.com/rails2010/public/schedule/detail/14502 Panelists: Joe Ferris (thoughtbot, inc), Jeremy Kemper (37signals), Marcel Molina (Twitter), Rick Olson (GitHub), Derek Willis (The New York Times) Authentication OAuth 1.0 spec is difficult to implement &#8211; signature difficulties, etc OAuth 2 uses ssl &#38; tokens &#8211; much simpler to implement, has overhead of SSL [...]]]></description>
			<content:encoded><![CDATA[<p>Building an API with Rails Panel  &#8211; http://en.oreilly.com/rails2010/public/schedule/detail/14502</p>
<p>Panelists:<a href="http://en.oreilly.com/rails2010/public/schedule/speaker/45872"> Joe  Ferris</a> (thoughtbot, inc),  	 	  		<a href="http://en.oreilly.com/rails2010/public/schedule/speaker/21443">Jeremy  Kemper</a> (37signals),  	 	  		<a href="http://en.oreilly.com/rails2010/public/schedule/speaker/82428">Marcel  Molina</a> (Twitter),  	 	  		<a href="http://en.oreilly.com/rails2010/public/schedule/speaker/2757">Rick  Olson</a> (GitHub),  	 	  		<a href="http://en.oreilly.com/rails2010/public/schedule/speaker/17183">Derek  Willis</a> (The New York Times)</p>
<p><strong>Authentication</strong></p>
<ul>
<li>OAuth 1.0 spec is difficult to implement &#8211; signature difficulties, etc</li>
<li>OAuth 2 uses ssl &amp; tokens &#8211; much simpler to implement, has overhead of SSL</li>
</ul>
<p><strong>Input &amp; Response Formats</strong></p>
<ul>
<li>Hoptoad now only supports XML &#8211; because they are write heavy and use streaming they were able to simplify their interface and make it faster by dropping support for other formats</li>
<li>NYTimes &#8211; XML &amp; JSON, expanded formats based on user needs</li>
<li>Twitter &#8211; XML, JSON, RSS, Atom &#8211; probably going to move towards JSON only to scale up &#8211; XML is too verbose &#8211; lots of memcache full of XML fragments</li>
<li>37signals &#8211; uses RJS</li>
</ul>
<p><strong>To Version or Not to Version<br />
</strong></p>
<ul>
<li>Twitter &#8211; hard problem &#8211; fork with multiple deploys? Inheritance? &#8211; lots of work. What do we need versioning for? Lotsa stuff we thought needed versioning actually didn&#8217;t. Looking for tips on how to do easily.</li>
<li>37signals &#8211; is it really a problem?  If you think it needs a new versions, just make it a new resource</li>
<li>How do you support legacy &#8211; 37signals: Given enough lead time application developers can deal with it fairly quickly (1 month).</li>
<li>Hoptoad &#8211; no matter how many people you tell, they won&#8217;t upgrade. You won&#8217;t loose as may people as you think. People don&#8217;t upgrade until something is broken.</li>
<li>Twitter &#8211; explosion of resources could be a problem. Implement new option/param/header to allow people to get new functionality during transition period. Look at analytics &amp; how much time has passed then take out conditional and drop previous. &#8220;It&#8217;s going to break if you don&#8217;t upgrade.&#8221;</li>
<li>NYTimes &#8211; &#8220;we&#8217;re shutting this off in 3 months&#8221;</li>
</ul>
<p><strong>Scaling</strong></p>
<ul>
<li>NYTimes uses <a href="http://www.mashery.com">mashery</a> and <a href="http://www.engineyard.com/blog/2010/varnish-its-not-just-for-wood-anymore/">varnish</a></li>
<li>37signals &#8211; reverse proxy caching, usage patterns of API are usually very different than patterns of web traffic</li>
<li>Twitter &#8211; cache not only fragments, but fragments of fragments &#8211; so that the more volatile stuff can expire without losing the more static data. Consider a streaming API instead of having users continuously poll. (mentioned &#8220;Cache Money&#8221; which I had to google cuz it&#8217;s a sweet name: http://github.com/nkallen/cache-money/tree/master)</li>
<li>Github &#8211; take advantage of HTTP headers &amp; caching</li>
</ul>
<p><strong>Code Separation</strong></p>
<ul>
<li>Should there be a separation between your web &amp; api code?</li>
<li>Github &#8211; API code was in same code as controllers &#8211; became separate API controller &#8211; looking at moving to a Sinatra app</li>
<li>Twitter &#8211; used to be DRY and works great for most applications. web/mobile/api encapsulated in respond to&#8217;s. Different code for rate limits, etc, &#8220;became unruly&#8221;, merge conflicts when split across teams, etc. Now they duplicate, but it&#8217;s not that bad because of skinny controllers &amp; fat models.</li>
<li>37signals &#8211; just because twitter does it, doesn&#8217;t mean you have to. Much much easier to keep API in same code, should be exception to separate &#8211; this is why respond_to exists.</li>
</ul>
<p><strong>Security Concerns</strong></p>
<ul>
<li>Twitter &#8211; &#8220;You&#8217;re going to get screwed no matter how awesome you are. And it&#8217;s a really hard problem.&#8221;</li>
<li>Github: Don&#8217;t use cookies &amp; sessions in your API requests</li>
<li>37signals &#8211; don&#8217;t worry about authenticating (use oauth) worry about authorization</li>
</ul>
<p><strong>Developer Communications</strong></p>
<ul>
<li>Twitter &#8211; Tools &amp; documentation &#8211; Page for &#8220;Is there a problem with the system?&#8221; &#8211; portal for developers</li>
<li>Hoptoad &#8211; make sure your documentation is correct &amp; up to date!</li>
<li>37signals &#8211; Don&#8217;t just put up a mailing list.</li>
<li>NYTimes &#8211; use your own API &#8211; build samples &amp; actually use/run them</li>
<li>Github &#8211; documentation is actually stored in git</li>
<li>37signals &#8211; dogfooding</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://brian.olore.net/wp/2010/06/railsconf-day-2-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

