<?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>Coffee on the Keyboard &#187; load</title>
	<atom:link href="http://coffeeonthekeyboard.com/tag/load/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeeonthekeyboard.com</link>
	<description>by James Socol</description>
	<lastBuildDate>Fri, 20 Apr 2012 22:17:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>		<item>
		<title>Help Me Scale</title>
		<link>http://coffeeonthekeyboard.com/help-me-scale-97/</link>
		<comments>http://coffeeonthekeyboard.com/help-me-scale-97/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:58:38 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Back-end]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[microblog]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[scalability]]></category>
		<category><![CDATA[social messaging]]></category>
		<category><![CDATA[subquery]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/help-me-scale-97/</guid>
		<description><![CDATA[I&#8217;ve been reading Eran Hammer-Lahav&#8217;s intelligent posts on microblog scalability, and now I&#8217;m concerned about my own &#8220;microblog&#8221; site, Picofiction. Similar to social networks, social updates, social messaging, social&#8230; Like many social web sites—amongst our weaponry&#8230;—Picofiction lets you &#8220;follow&#8221; your favorite authors, displaying all their posts along with yours. I handle this very naïvely: everything [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading Eran Hammer-Lahav&#8217;s <a href="http://www.hueniverse.com/hueniverse/2008/04/scaling-a-micro.html">intelligent</a> <a href="http://www.hueniverse.com/hueniverse/2008/03/scaling-a-micro.html">posts on</a> <a href="http://www.hueniverse.com/hueniverse/2008/03/on-scaling-a-mi.html">microblog scalability</a>, and now I&#8217;m concerned about my own &#8220;microblog&#8221; site, <a href="http://picofiction.com/">Picofiction</a>.</p>
<p>Similar to social networks, social updates, social messaging, social&#8230; Like many social web sites—amongst our weaponry&#8230;—Picofiction lets you &#8220;follow&#8221; your favorite authors, displaying all their posts along with yours.</p>
<p>I handle this very naïvely: everything is offloaded to the database. There are three tables involved here, one of users, one of posts, and one of follower/followee bindings.</p>
<p>Here&#8217;s the basic structure of this query:</p>
<pre>SELECT post_id, post_body, post_date, post_type,
  user_name AS author_name, user_id AS author_id
FROM posts
LEFT JOIN users
ON posts.author_id = users.user_id
WHERE author_id = '<var>CURRENT_USER</var>'
OR author_id IN (
  (SELECT followed_id
   FROM followers
   WHERE following_id = '<var>CURRENT_USER</var>')
  )
ORDER BY post_date DESC
LIMIT <var>PAGE_START</var>,20;</pre>
<p>Here&#8217;s where I need help: this works great on a single database, but it does not scale horizontally.</p>
<p>Since this horizontal scalability is such a hot topic right now, I&#8217;m asking for ideas. I&#8217;d like to put in the infrastructure <em>before</em> there is a need for it.</p>
<p>Eran points out that caching is not as simple a solution as we&#8217;d like to think. What do you cache? How do you keep caches in sync?</p>
<p>Does anyone have experience with MySQL Cluster Servers? It seems like the best way of scaling is to make the process as <a href="http://en.wikipedia.org/wiki/Amdahl%27s_law">parallelizable</a> as possible. The database then handles the parallelization, so the less I can do in the program the better, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/help-me-scale-97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

