<?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"
	>

<channel>
	<title>StyleFeeder Tech Blog</title>
	<atom:link href="http://blog.tech.stylefeeder.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tech.stylefeeder.com</link>
	<description>Bitheads Invade the Fashion World</description>
	<pubDate>Tue, 15 Jul 2008 19:59:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>MySQL Analysis Tools</title>
		<link>http://blog.tech.stylefeeder.com/2008/07/15/mysql-analysis-tools/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/07/15/mysql-analysis-tools/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 19:59:13 +0000</pubDate>
		<dc:creator>kilby</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[mysql innodb innotop mysqlreport performance]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=25</guid>
		<description><![CDATA[I&#8217;ve been having some odd performance issues with some of my MySQL queries since moving over to InnoDB.  I picked up the new O&#8217;Reilly title High Performance MySQL to try to track down the problem.  The book in turn recommends a couple of pretty cool monitoring/reporting tools that summarize a lot of the MySQL variable [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having some odd performance issues with some of my <a href="http://www.mysql.com">MySQL</a> queries since moving over to InnoDB.  I picked up the new O&#8217;Reilly title <a href="http://www.amazon.com/High-Performance-MySQL-Optimization-Replication/dp/0596101716/ref=pd_bbs_sr_1?ie=UTF8&amp;tag=stylefeeder-20&amp;s=books&amp;qid=1216151187&amp;sr=8-1">High Performance MySQL</a> to try to track down the problem.  The book in turn recommends a couple of pretty cool monitoring/reporting tools that summarize a lot of the <a href="http://www.mysql.com">MySQL</a> variable displays in a more friendly format.</p>
<p><a href="http://sourceforge.net/projects/innotop">Innotop </a>(more info <a href="http://www.xaprb.com/blog/2006/07/02/innotop-mysql-innodb-monitor/">here</a>) is sort of like the friendly unix top command, but instead for database status.  There are pages to show buffer statuses, deadlocks, i/o status, current queries, and lots more.  They all update on screen, at configurable increments.</p>
<p><a href="http://hackmysql.com/">MySQLReport</a> from <a href="http://hackmysql.com/">hackmysql.com</a> runs a few status commands and formats them nicely on screen in a nice grouped format.  <a href="http://www.hackmysql.com/mysqlreportguide">This guide</a> summarizes the sections, which include more detail on many of the same things that innotop covered.  I find the sections on SELECT types, and InnoDB Buffer Pool use, are especially useful to me.</p>
<p>Using the command type summary, we discovered an inordinate number of com_rollback calls in our main database, which we were able to reduce by using <a href="http://forums.mysql.com/read.php?39,200681,200696#msg-200696">this technique</a>.  The root cause was <a href="http://www.hibernate.org">Hibernate</a>&#8217;s love of transactions, combined with connection pooling.  A simple driver parameter seems to clear it up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/07/15/mysql-analysis-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy 4th from StyleFeeder engineering</title>
		<link>http://blog.tech.stylefeeder.com/2008/07/05/happy-4th-from-stylefeeder-engineering/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/07/05/happy-4th-from-stylefeeder-engineering/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 15:49:54 +0000</pubDate>
		<dc:creator>kilby</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[holiday office 4th july fireworks photos]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=24</guid>
		<description><![CDATA[Boston was a key city in the War for Independence, and to celebrate that there is a big fireworks display over the Charles River every year.  This year the Erics of StyleFeeder (Savage and Kilby) were looking for a place to watch the show.  Down by the river was a mass of humanity, even compared [...]]]></description>
			<content:encoded><![CDATA[<p>Boston was a key city in the <a href="http://en.wikipedia.org/wiki/War_for_Independence">War for Independence</a>, and to celebrate that there is a big fireworks display over the <a href="http://en.wikipedia.org/wiki/Charles_River">Charles River</a> every year.  This year the Erics of <a href="http://www.stylefeeder.com">StyleFeeder </a>(Savage and Kilby) were looking for a place to watch the show.  Down by the river was a mass of humanity, even compared to previous years, so we were worried about missing the show.  Then it occurred to us, doesn&#8217;t <a href="http://www.stylefeeder.com/info/contact.html">our office</a> have a view down towards the river without many tall buildings in the way?  This proved to be the case, and we had a spectacular view of the show directly over the famous <a href="http://hacks.mit.edu/Hacks/by_location/great_dome.html">MIT Dome</a>.</p>
<p><a href="http://flickr.com/photos/efsavage/2638460714/sizes/l/"><img src="http://farm4.static.flickr.com/3013/2638460714_499d19c000.jpg?v=0" alt="" width="500" height="332" /></a></p>
<p>(photo by <a href="http://www.flickr.com/photos/efsavage">Eric Savage</a>)</p>
<p><a href="http://flickr.com/photos/ekilby/2637554373/sizes/l/"><img src="http://farm4.static.flickr.com/3046/2637554373_c915a46cd6.jpg?v=0" alt="" /></a></p>
<p>(photo by <a href="http://www.flickr.com/photos/ekilby">Eric Kilby</a>)</p>
<p>The rest of the pictures can be found at these links via <a href="http://www.flickr.com">Flickr</a>.  Remember, <a href="http://creativecommons.org/">Creative Commons</a> licensing is your friend, so feel free to use these as you wish.</p>
<ul>
<li><a href="http://flickr.com/photos/efsavage/sets/72157605982082942/">More July 4, 2008 photos by Eric Savage</a></li>
<li><a href="http://flickr.com/photos/ekilby/sets/72157605986470467/">More July 4, 2008 photos by Eric Kilby</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/07/05/happy-4th-from-stylefeeder-engineering/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is that server running a bit slow?</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/30/is-that-server-running-a-bit-slow/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/30/is-that-server-running-a-bit-slow/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 18:24:19 +0000</pubDate>
		<dc:creator>Philip Jacob</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[load]]></category>

		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=23</guid>
		<description><![CDATA[top - 12:59:09 up 6 days, 15:51,  4 users,  load average: 1050.04, 753.62, 356.
Tasks: 150 total,  24 running, 126 sleeping,   0 stopped,   0 zombie
Cpu(s): 12.2%us, 87.8%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2059260k total,  2049260k used,    [...]]]></description>
			<content:encoded><![CDATA[<pre>top - 12:59:09 up 6 days, 15:51,  4 users,  load average: 1050.04, 753.62, 356.
Tasks: 150 total,  24 running, 126 sleeping,   0 stopped,   0 zombie
Cpu(s): 12.2%us, 87.8%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2059260k total,  2049260k used,    10000k free,     2412k buffers
Swap:  4208608k total,   523792k used,  3684816k free,   116432k cached
</pre>
<p>*shakes head in disbelief*</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/30/is-that-server-running-a-bit-slow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LinkShare Golden Link Awards and Symposium</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/27/linkshare-golden-link-awards-and-symposium/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/27/linkshare-golden-link-awards-and-symposium/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 21:58:04 +0000</pubDate>
		<dc:creator>kilby</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[linkshare symposium golden link award new york june 200]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=21</guid>
		<description><![CDATA[A few weeks ago we got a pointer to the LinkShare developer contest, open to any of their publishers who are using their web services in interesting ways.  I wrote up an entry, mailed it in, and didn&#8217;t think too much about it for a while.  Then a couple of weeks ago we [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago we got a pointer to the <a href="http://www.linkshare.com">LinkShare </a>developer contest, open to any of their publishers who are using their web services in interesting ways.  I wrote up an entry, mailed it in, and didn&#8217;t think too much about it for a while.  Then a couple of weeks ago we got a message saying that we&#8217;re finalists for their Technology Genius Award, and that we should plan on having someone attend the festivities.</p>
<p>Fast forward to this week and I boarded the <a href="http://www.limoliner.com">LimoLiner </a>bus and headed off to New York.  A few hours later I was checking into the Sheraton, and not long after that I was boarding another bus for the Plaza Hotel and the Golden Link Awards ceremony.  After spending some time in a very dressy crowd, feeling like a fish out of water, I made my way to my seat at a table near the front of the room and after a nice lobster appetizer and steak dinner it was time for the show, hosted by <a href="http://www.imdb.com/name/nm0261435/">Susie Essman</a> (best known from <a href="http://www.imdb.com/title/tt0264235/">Curb Your Enthusiasm</a>).</p>
<p>Well into the program, it was time for the Technology Genius Award and the butterflies started going in my stomach.  And the award goes to&#8230;. StyleFeeder!   Went up, shook some hands, made a speech, and sat back down, all in a blur.  After the show was over, got on another bus and returned to the hotel with trophy in tow.  People kept asking if it was an Oscar, and I kept answering in the affirmative.</p>
<p>The next morning, up bright and early, I got on another bus to head down to <a href="http://http//www.chelseapiers.com/">Chelsea Piers</a> down by the Hudson River, site of this year&#8217;s <a href="http://www.linkshare.com/events/linkshare_symposium/">LinkShare Symposium</a>.  The morning was filled with speakers, headlined by <a href="http://http//en.wikipedia.org/wiki/James_Surowiecki">James Surowiecki</a>, the author of <a href="http://http//www.amazon.com/Wisdom-Crowds-James-Surowiecki/dp/0385721706"><em>The Wisdom of Crowds</em></a>.  After lunch and more presentations, it was networking time, in which I was somewhat out of my element.  During that time I ran into Adam Weiss of LinkShare, who had helped me with some technical issues back in the Spring, and he introduced me to Jessica Kingman who is our account manager over there.  They both had good suggestions in terms of people who I should meet and talk to, and I made my way around to several of the advertisers booths exchanging cards and collecting conference swag.  I even won another contest, taking away a nice 9 bottle wine cellar courtesy of our fellow Bostonians at <a href="http://www.smartbargains.com">SmartBargains.com</a>.  The conference finished around 6, and I headed back to the hotel with the guys from <a href="http://www.buzzillions.com">Buzzillions.com</a> to drop off our bags.</p>
<p>After a long New York style evening of after, after-after, and after-after-after parties and some much needed rest, I boarded the LimoLiner back to Boston, with a shiny trophy nestled in my bag.  It was worth the trip, and thanks to <a href="http://www.linkshare.com">LinkShare</a> and all their friendly people for making it a great trip.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/27/linkshare-golden-link-awards-and-symposium/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Facebook Gotchas</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/25/facebook-gotchas/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/25/facebook-gotchas/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 15:36:43 +0000</pubDate>
		<dc:creator>savage</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[facebook]]></category>

		<category><![CDATA[gotchas]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=20</guid>
		<description><![CDATA[We just did a little refresh of our Facebook profile box, and I learned a couple things along the way that would have been nice to know ahead of time:

I knew that Facebook caches all referenced images, but I didn&#8217;t know that they will resize any referenced image larger than 400px down to 400px.
If an [...]]]></description>
			<content:encoded><![CDATA[<p>We just did a little refresh of our Facebook profile box, and I learned a couple things along the way that would have been nice to know ahead of time:</p>
<ul>
<li>I knew that Facebook caches all referenced images, but I didn&#8217;t know that they will resize any referenced image larger than 400px down to 400px.</li>
<li>If an image is inaccessible for any reason (404, timeout, etc) it will be replaced with a blank image and cached, so you will need to change the name of the image when doing iterations.</li>
<li>FBML includes &lt;fb:narrow&gt; and &lt;fb:wide&gt; for providing different content to the two available profile columns, and this will work even with the Ajax-y reloading of a user moving the box.  However, Facebook rewrites your css so that you don&#8217;t mess up the page, and the drag-n-drop doesn&#8217;t affect this, so don&#8217;t put css in these two tags.  Instead, put your HTML in the tags, with different classes/ids.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/25/facebook-gotchas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Xconomy cloud computing event</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/24/cloud-computing/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/24/cloud-computing/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 00:23:11 +0000</pubDate>
		<dc:creator>Philip Jacob</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=19</guid>
		<description><![CDATA[I had the pleasure of speaking on a panel about cloud computing today in Boston.  The panel was part of a conference on the subject hosted by Xconomy in Akamai&#8217;s wonderful facilities in Kendall Square.  One of the things that jumped out was that there absolutely is no consensus of what cloud computing [...]]]></description>
			<content:encoded><![CDATA[<p>I had the pleasure of speaking on a panel about cloud computing today in Boston.  The panel was part of a conference on the subject hosted by <a href="http://www.xconomy.com/boston/">Xconomy</a> in <a href="http://www.akamai.com/">Akamai</a>&#8217;s wonderful facilities in Kendall Square.  One of the things that jumped out was that there absolutely is no consensus of what cloud computing is, an observation made by <a href="http://www.jcoates.org/">Josh Coates</a>, who pointed to the currently fluffy state of the Wikipedia <a href="http://en.wikipedia.org/wiki/Cloud_computing">page on the subject</a>.</p>
<p><a href="http://www.johnlandry.com/">John Landry</a> did a great job moderating the panel and keeping things lively - he had some particularly good observations in his opening remarks about some of the key forces behind cloud computing (no matter what your definition is), including open source software, cheap hardware and virtualization (plus two more that I can&#8217;t remember).  However, I think the most important factor that will determine your ability to join any kind cloud computing program is your system architecture.  It&#8217;s one thing to be able to spin up 100 virtualized Linux boxen on EC2, but it&#8217;s quite something else to be able to integrate those dynamically into a running system.  If you can&#8217;t do that, then you&#8217;re at a disadvantage (I made the point that we at StyleFeeder have 100 databases in production and that we can very easily move those around to scale up our data tier).  John also talked about the gradual move away from traditional relational databases to key/value stores, which prompted some good discussion.</p>
<p>The conference was full of people who were clearly interested in the subject matter, but it seemed like many of them haven&#8217;t yet taken the plunge.  Contrast that with another talk that I gave this morning at the <a href="http://www.yalestartups.com/">Yale Entrepreneurial Institute</a>: how many of these students had heard of EC2?  Pretty much all of them who are doing software startups.  Not surprising.  I bet most of them are using virtualized systems of some flavor.</p>
<p>Cloud computing seems to be on everybody&#8217;s radar screens these days, even if nobody seems to have a clear idea of what it is.</p>
<p>(<a href="http://torrez.us/">Elias</a> and <a href="http://yoavs.blogspot.com/">Yoav</a> were also at the cloud computing event, but Elias left early because he&#8217;s lame.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/24/cloud-computing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Two must-have Java tools</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/23/javarebel-and-eclipse-memory-analysis/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/23/javarebel-and-eclipse-memory-analysis/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 17:03:48 +0000</pubDate>
		<dc:creator>Philip Jacob</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=18</guid>
		<description><![CDATA[I&#8217;ve been absolutely loving JavaRebel, a java agent that reloads modified classes at runtime, thereby obviating the need to start or stop some long running piece of code (say, an app server or some other kind of daemon).  It&#8217;s not, unfortunately, open source, but it is inexpensive and the time savings so far are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been absolutely loving <a href="http://www.zeroturnaround.com/javarebel/">JavaRebel</a>, a java agent that reloads modified classes at runtime, thereby obviating the need to start or stop some long running piece of code (say, an app server or some other kind of daemon).  It&#8217;s not, unfortunately, open source, but it is inexpensive and the time savings so far are considerable.  I ran it for three weeks using their free trial version expecting to find some kind of showstopping bug&#8230; but that never materialized.  Integrating it is really easy&#8230; just a simple change to the command line that runs your java code.  I&#8217;ve only found one caveat that requires any thought at all, which usually has to do with the modification of static fields, but it&#8217;s really not a big deal.  I reckon that this saves me 15 minutes per day, which&#8230; well, it&#8217;s quite a lot.  And I don&#8217;t remember the last time that I found software that could do that for me.</p>
<p>I also had a little incident with a 1.5Gb heap dump yesterday.  I wanted to analyze it after one of our app servers coughed it up (right before it crashed hard) to find out what the problem was.  I tried <a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html">jhat</a>, which seemed to require more memory than could possibly fit into my laptop (with 4Gb).  I tried <a href="http://www.yourkit.com/">Yourkit</a>, which also stalled trying to read this large dump file (actually, Yourkit&#8217;s profiler looked pretty cool, so I shall probably revisit that).  I even tried firing up jhat on an <a href="http://www.amazon.com/gp/browse.html?node=201590011">EC2</a> box with 15Gb of memory&#8230; but that also didn&#8217;t work.  Finally, I ran across the <a href="http://www.eclipse.org/mat/">Eclipse Memory Analyzer</a>.  Based on my previous two experiences, I didn&#8217;t expect this one to work&#8230;. but, holy cow, it did.  Within just a few minutes, I had my culprit nailed (big memory leak in XStream 1.2.2) and I was much further along than I was previously.  I actually downloaded the standalone version&#8230; I usually don&#8217;t need memory analyzers very often, so I didn&#8217;t want to saddle my regular Eclipse with something new.  I highly recommend this tool - it worked like a charm with a very big file and was also very easy to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/23/javarebel-and-eclipse-memory-analysis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>StyleFeeder won an MITX award!</title>
		<link>http://blog.tech.stylefeeder.com/2008/06/04/stylefeeder-won-an-mitx-award/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/06/04/stylefeeder-won-an-mitx-award/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 01:53:41 +0000</pubDate>
		<dc:creator>Philip Jacob</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[argumentarium]]></category>

		<category><![CDATA[fire threat]]></category>

		<category><![CDATA[hubspot]]></category>

		<category><![CDATA[mitx]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=15</guid>
		<description><![CDATA[Last night, we had a bit of a (good) surprise by winning an award from MITX in the &#8220;Collaboration and social networking&#8221; category.  Hey, it&#8217;s not every day that something like this happens, so we have to savor these moments!

Our friends at HubSpot also won also won (Hey, Dharmesh and Yoav!).  I ran [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, we had a bit of a (good) surprise by winning an award from <a href="http://www.mitx.org">MITX</a> in the &#8220;Collaboration and social networking&#8221; category.  Hey, it&#8217;s not every day that something like this happens, so we have to savor these moments!</p>
<p style="text-align: center;"><a href="http://www.mitxawards.org/technologyawards/finalists_winners.aspx?year=2008"><img class="alignnone size-medium wp-image-16" title="MITX award, 2008" src="http://blog.tech.stylefeeder.com/wp-content/uploads/2008/06/techawards_08winner.gif" alt="MITX award, 2008" width="288" height="145" /></a></p>
<p>Our friends at <a href="http://www.hubspot.com/">HubSpot</a> also won also won (Hey, Dharmesh and Yoav!).  I ran into <a href="http://www.hubspot.com/company/management/brian-halligan">Brian Halligan</a> (CEO of HubSpot) and well-known troublemaker <a href="http://argumentarium.com/">Ed Lyons</a> after the event (Ed then proceeded to lecture Katie Rae of Microsoft about the pitfalls of SharePoint, but let&#8217;s just pretend that part didn&#8217;t happen).</p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-17" title="Brian Halligan and Ed Lyons" src="http://blog.tech.stylefeeder.com/wp-content/uploads/2008/06/dsc00484.jpg" alt="Brian Halligan and Ed Lyons" width="300" height="225" /></p>
<p style="text-align: left;">One thing I&#8217;m particularly glad about is that we received our award <em>before</em> the fire alarms went off, which prompted a mass exodus out in front of the hotel over looking the river.  Hey, if you have to evacuate your hotel due to a fire threat, that&#8217;s a nice place to do it (our <a href="http://www.whirlycott.com/phil/2007/11/30/the-key-to-shopping-20-success-empowering-customers/">previous experience</a> with flames involved a bit more action).</p>
<p style="text-align: left;">Congrats to the other winners from all of us at StyleFeeder!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/06/04/stylefeeder-won-an-mitx-award/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Generating Primary Keys</title>
		<link>http://blog.tech.stylefeeder.com/2008/05/27/generating-primary-keys/</link>
		<comments>http://blog.tech.stylefeeder.com/2008/05/27/generating-primary-keys/#comments</comments>
		<pubDate>Tue, 27 May 2008 16:12:54 +0000</pubDate>
		<dc:creator>Jason Rennie</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[primary key]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/?p=14</guid>
		<description><![CDATA[
A primary key for each row of a table in a database is virtually a requirement of database design.  Occasionally, the data for a table provides a primary key (e.g. username or email for an account table).  More common is that one needs to generate primary key values for a table.  Yet, [...]]]></description>
			<content:encoded><![CDATA[<p>
A primary key for each row of a table in a database is virtually a requirement of database design.  Occasionally, the data for a table provides a primary key (e.g. username or email for an account table).  More common is that one needs to generate primary key values for a table.  Yet, tools for this in MySQL/Java are limited.  MySQL offers auto_increment, but there are issues with replication, it can become a bottleneck for insert-heavy tables, it doesn&#8217;t provide globally unique ids and displaying these ids publicly may expose sensitive information.  Java offers java.util.uuid, which gives pseudo-random 128-bit values.  The chance of a collision is minuscule, but non-zero.  More troubling is the size of the string representation: 36 characters.  Since InnoDB uses the primary key index as the storage structure for the data and uses primary keys as data pointers for secondary indexes, long keys not only waste space, but make the database less efficient.
</p>
<p>
After evaluating these options and a few ideas of our own for primary key generation, we settled on a simple algorithm motivated by group theory.  The advantages of this algorithm are numerous:</p>
<ul>
<li>Short Keys (6 characters yield 57 billion unique keys using only alphanumeric characters)
<li>Universal Uniqueness (no guessing to which table a key value refers)
<li>Pseudo-randomness (keys don&#8217;t follow an obvious pattern)
<li>No Duplicate-Checking (keys are guaranteed to be unique until a limit is reached)
<li>Block Generation (keys are generated in blocks to minimize lock contention)
</ul>
</p>
<p>
Our generator uses one tiny bit of group theory: if k and n are coprime (aka relatively prime), the sequence of numbers generating by successively adding k (mod n) will not repeat through the first n values.  This leads to the following algorithm for generating unique keys:</p>
<ul>
<li>Pick a size n
<li>Pick a value k which is coprime with n
<li>To generate the next key: nextKey = (lastKey + k) % n
</ul>
<p>You&#8217;ll be guaranteed to not see duplicates until you&#8217;ve generated n keys.  The sequence you&#8217;d see with n=5 and k=3 is { 0, 3, 1, 4, 2, 0, 3, &#8230; }.
</p>
<p>
Note that the choices of n and k are quite important&#8212;they must be fixed and can never change.  However, selecting reasonable values is not difficult.  For n, select a character set and string length, then set n to be the number of possible unique strings.  To get the 57 billion value above, use a string length of 6 and a character set of [0-9a-zA-Z] (62 characters).  57 billion is simply the number of unique, 6 character alphanumeric strings (62^6).  If you grow to the point that you are worried about key collisions, switch to using 7 character strings (where n=62^7, appx. 3.5 trillion).  Note that conversion from the key number value to string value is simply a conversion from base 10 to base 62 (or whatever # of characters you are using).
</p>
<p>
For k, we need a value that is coprime with n.  To achieve pseudo-randomness, k should also not be too small (the same order as n is a good choice).  Note that this &#8220;randomness&#8221; is quite weak in a mathematical sense, but was sufficient for our purposes.  One way to select such a k is to multiply together prime numbers larger than the character set size.  For our example, a reasonable choice would be k=67*71*73*79*83*89.  If you don&#8217;t have your own prime number generator, consult <a href="http://alpha61.com/primenumbershittingbear/">the bear</a>.
</p>
<p>
To put this algorithm into practice, one needs to ensure that keys are generated serially.  We did this by creating a table with a single row with a single column storing the last key value.  When we want to generate a key (or block of keys), we start a SERIALIZABLE transaction, read the last key value, generate key(s) per the above algorithm, then write back the last key value we generated and close the transaction.  To minimize contention and since next key computation is much faster than a transaction, we generate keys in blocks and serve them out of memory via a synchronized HashMap.  This causes key values to occasionally be permanently lost when a webapp is shut down, but the lossage is too small to be of any real concern.
</p>
<p>
We&#8217;ve been using this system for many months now and have yet to run into any problems.  It satisfies all of our current needs and has the advantage that it can easily scale either by using longer character strings or increasing the key generation block size.  Furthermore, it seems to be extremely lightweight, exerting minimal pressure on our database.  We would love to hear what other solutions for primary key generation are used.  How does ours compare?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2008/05/27/generating-primary-keys/feed/</wfw:commentRss>
		</item>
		<item>
		<title>StyleFeeder is hiring: Senior Developer / Architect</title>
		<link>http://blog.tech.stylefeeder.com/2007/12/03/stylefeeder-is-hiring-senior-developer-architect/</link>
		<comments>http://blog.tech.stylefeeder.com/2007/12/03/stylefeeder-is-hiring-senior-developer-architect/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 22:32:25 +0000</pubDate>
		<dc:creator>Philip Jacob</dc:creator>
		
		<category><![CDATA[jobs]]></category>

		<guid isPermaLink="false">http://blog.tech.stylefeeder.com/2007/12/03/stylefeeder-is-hiring-senior-developer-architect/</guid>
		<description><![CDATA[We&#8217;re hiring hackers.  If you&#8217;ve got what it takes, read through this and contact us.
Note: no recruiters or third parties, please. 
Who We Are
We&#8217;re StyleFeeder, and we&#8217;re trying to improve how people shop. Online shopping is currently focused on impulse buying, price seeking, and moving inventory. We think it should be about connecting people [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re hiring hackers.  If you&#8217;ve got what it takes, read through this and contact us.</p>
<p><em>Note: no recruiters or third parties, please. </em></p>
<p><strong>Who We Are</strong></p>
<p>We&#8217;re StyleFeeder, and we&#8217;re trying to improve how people shop. Online shopping is currently focused on impulse buying, price seeking, and moving inventory. We think it should be about connecting people to products that are the best choice for them, based entirely on individual preferences. This is a big, exciting challenge, and we want to meet it.</p>
<p><strong>Who We&#8217;re Looking For</strong></p>
<p>We&#8217;re looking for a rockstar developer who wants to challenge themselves, us, and the status quo by pushing the boundaries of what users can do. We need someone full of ideas and talent that can create, refine, and execute concepts from beginning to end, prototype to production. Take a look at our site and ask two questions, &#8220;Could I have built this?&#8221; and &#8220;Can I make this better?&#8221;. If the answer to both questions is yes, we should talk.</p>
<p><strong>What We Use</strong></p>
<p>Java, Eclipse, Hibernate, MySQL, Linux, Apache for starters. We also use Subversion, Spring, Flex, Struts, Cocoon, JSP, JavaScript, CSS, XML, the list goes on. We look past the buzzwords like AJAX and Web 2.0 and find the good stuff hidden in the marketing wrapper. We move fast, so we need someone who has real experience and proficiency in most of those areas, and is capable of bringing themselves up to speed quickly on the rest.</p>
<p><strong>Talk To Us</strong></p>
<p>Send us your <em>resume</em> and a brief <em>writeup</em> about a project that excited you, and why it did so. If you have a <em>blog or any whitepapers or articles</em> you can share with us, we&#8217;d love to see those too. Email us at dev/at/stylefeeder/com</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tech.stylefeeder.com/2007/12/03/stylefeeder-is-hiring-senior-developer-architect/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
