<?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>Mike Brittain &#187; twitter</title>
	<atom:link href="http://www.mikebrittain.com/blog/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikebrittain.com/blog</link>
	<description>Internet, mobile applications, skiing, snowboarding, food... you know, whatever comes to mind.</description>
	<lastBuildDate>Sun, 22 Jan 2012 16:24:32 +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>Twitter&#8217;s Photo Storage (from the outside looking in)</title>
		<link>http://www.mikebrittain.com/blog/2010/05/24/twitter-photo-storage-and-serving/</link>
		<comments>http://www.mikebrittain.com/blog/2010/05/24/twitter-photo-storage-and-serving/#comments</comments>
		<pubDate>Tue, 25 May 2010 01:56:26 +0000</pubDate>
		<dc:creator>Mike Brittain</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudfront]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.mikebrittain.com/blog/?p=469</guid>
		<description><![CDATA[I&#8217;ve been working on some photo storage and serving problems at Etsy, which is exciting work given the number of photos we store for the items being sold on the site.  This sort of project makes you wonder how other sites are handling their photo storage and serving architectures. Today I spent a few minutes [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on some photo storage and serving problems at <a href="http://www.etsy.com/">Etsy</a>, which is exciting work given the number of photos we store for the items being sold on the site.  This sort of project makes you wonder how other sites are handling their photo storage and serving architectures.</p>
<p>Today I spent a few minutes looking at avatar photos from Twitter <em>from the outside</em>.  This is all from inspection of URLs and HTTP headers, and completely unofficial and unvalidated assumptions.</p>
<p>Two things I found interesting today were (1) the rate of new avatar photos being added to Twitter, and (2) the architecture for storing and serving images.</p>
<h2>Avatars</h2>
<p>Avatar photos at Twitter have URLs that look something like the following:</p>
<pre><code>http://a3.twimg.com/profile_images/<strong>689887435</strong>/my_photo.jpg</code></pre>
<p>I&#8217;m <em>assuming</em> the numeric ID increments linearly with each photo that is uploaded&#8230; two images uploaded a few minutes apart showed a relatively small increase between these IDs.  I compared one of these IDs with the ID of an older avatar, along with the &#8220;Last-Modified&#8221; header that was included with its HTTP response headers:</p>
<pre><code>Last-Modified Tue, 26 Feb 2008 03:15:46 GMT</code></pre>
<p>Comparing these numbers shows that Twitter is currently ingesting somewhere over two million avatars per day.</p>
<p>Stock, or library, avatars have different URLs, meaning they are not served or stored the same way as custom avatars.  This is good because you get the caching benefits of reusing the same avatar URL for multiple users.</p>
<pre><code>http://s.twimg.com/a/1274144130/images/default_profile_6_normal.png</code></pre>
<h2>Storage and Hosting</h2>
<p>Running a &#8220;host&#8221; look up on the hostname of an avatar URL shows a CNAME to Akamai&#8217;s cache network:</p>
<pre>$ host a3.twimg.com
a3.twimg.com is an alias for a3.twimg.com.<strong>edgesuite.net</strong>.
a3.twimg.com.edgesuite.net is an alias for a948.l.<strong>akamai.net</strong>.
a948.l.akamai.net has address 96.6.41.171
a948.l.akamai.net has address 96.6.41.170</pre>
<p>If you&#8217;re familiar with Akamai&#8217;s network, you can dig into response headers that come from their cache servers.  I did a little of that, but the thing I found most interesting is that Akamai plucks avatar images from Amazon&#8217;s CloudFront service.</p>
<pre>x-amz-id-2: NVloBPkil5u…
x-amz-request-id: 1EAA3DE5516E…
Server: AmazonS3
X-Amz-Cf-Id: 43e9fa481c3dcd79…</pre>
<p>It&#8217;s not news that Twitter uses S3 for storing their images, but I hadn&#8217;t thought about using CloudFront (which is effectively a CDN) as an origin to another CDN.  The benefit here, aside from not pounding the crap out of S3, is that Akamai&#8217;s regional cache servers can pull avatars from CloudFront POPs that are relatively close, as opposed to reaching all the way back to a single S3 origin (such as the &#8220;US Standard Region&#8221;, which I believe has two locations in the US).  CloudFront doesn&#8217;t have nearly as many global POPs as Akamai. But using it does speed up image delivery by ensuring that Akamai&#8217;s cache servers in Asia are grabbing files from a CloudFront POP in Hong Kong or Singapore, rather than jumping across the Pacific to North America.</p>
<p>I suspect that Twitter racks up a reasonably large bill with Amazon by storing and serving so many files from S3 and CloudFront.  However, it takes away the burden of owning all of the hardware, bandwidth, and man power required to serve millions upon millions of images&#8230; especially when that is not a core feature of their site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikebrittain.com/blog/2010/05/24/twitter-photo-storage-and-serving/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Traffic Reports via Twitter</title>
		<link>http://www.mikebrittain.com/blog/2008/05/19/traffic-reports-via-twitter/</link>
		<comments>http://www.mikebrittain.com/blog/2008/05/19/traffic-reports-via-twitter/#comments</comments>
		<pubDate>Mon, 19 May 2008 15:57:45 +0000</pubDate>
		<dc:creator>Mike Brittain</dc:creator>
				<category><![CDATA[WWW]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://mikebrittain.wordpress.com/?p=102</guid>
		<description><![CDATA[Just came across this Twitter feed by accident (no pun intended)&#8230; Boston is apparently using Twitter feeds to broadcast messages about traffic conditions in the area. I wonder who else is doing this?  I don&#8217;t have time at the moment to check in on others, but this is really interesting in terms of what other [...]]]></description>
			<content:encoded><![CDATA[<p>Just came across this <a href="http://twitter.com/">Twitter</a> feed by accident (no pun intended)&#8230; <a href="http://twitter.com/trafficboston/">Boston</a> is apparently using Twitter feeds to broadcast messages about traffic conditions in the area.</p>
<p>I wonder who else is doing this?  I don&#8217;t have time at the moment to check in on others, but this is really interesting in terms of what other public information could be broadcast in this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikebrittain.com/blog/2008/05/19/traffic-reports-via-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which Presidential Candidate Uses Twitter More?</title>
		<link>http://www.mikebrittain.com/blog/2008/04/08/which-presidential-candidate-uses-twitter-more/</link>
		<comments>http://www.mikebrittain.com/blog/2008/04/08/which-presidential-candidate-uses-twitter-more/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 20:24:46 +0000</pubDate>
		<dc:creator>Mike Brittain</dc:creator>
				<category><![CDATA[WWW]]></category>
		<category><![CDATA[barackobama]]></category>
		<category><![CDATA[hillaryclinton]]></category>
		<category><![CDATA[tweetstats]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://mikebrittain.wordpress.com/?p=92</guid>
		<description><![CDATA[Everyone&#8217;s talking about TweetStats. Rather than talk about how cool TweetStats is, I thought I&#8217;d show off some stats for two people I didn&#8217;t realize were Twitter users until today. OK, I don&#8217;t really believe that either of these two are actually writing these, er&#8230; &#8220;tweets&#8220;. But&#8230; Barack Obama is totally kicking Hillary Clinton&#8216;s ass [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone&#8217;s talking about <a href="http://www.tweetstats.com/">TweetStats</a>.</p>
<p>Rather than talk about how cool TweetStats is, I thought I&#8217;d show off some stats for two people I didn&#8217;t realize were <a href="http://www.twitter.com/">Twitter</a> users until today.  OK, I don&#8217;t really believe that either of these two are <em>actually</em> writing these, er&#8230; &#8220;<a href="http://www.red-sweater.com/blog/474/word-of-tweet-marketing">tweets</a>&#8220;.</p>
<p>But&#8230;</p>
<p><a href="http://www.tweetstats.com/graphs/barackobama">Barack Obama</a> is totally kicking <a href="http://www.tweetstats.com/graphs/hillaryclinton">Hillary Clinton</a>&#8216;s ass on Twitter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikebrittain.com/blog/2008/04/08/which-presidential-candidate-uses-twitter-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

