<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Bloggitation comments on MapReduce for Ruby: Ridiculously Easy Distributed Programming</title>
    <link>http://typo.onxen.info/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Bloggitation comments</description>
    <item>
      <title>"MapReduce for Ruby: Ridiculously Easy Distributed Programming" by stoyan</title>
      <description>&lt;p&gt;Google’s &lt;a href="http://tech.rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html"&gt;MapReduce is now available for Ruby&lt;/a&gt; (via &lt;em&gt;gem install starfish&lt;/em&gt; ). &lt;a href="http://labs.google.com/papers/mapreduce.html"&gt;MapReduce&lt;/a&gt; is the technique used by Google to do monstrous distributed programming over 30 terabyte files.&lt;/p&gt;


Here is the basic code that will get you up and running with MapReduce in &lt;a href="http://rufy.com/starfish/doc/classes/Starfish.html"&gt;Starfish&lt;/a&gt; .
&lt;pre&gt;
    # item.rb
    ActiveRecord::Base.establish_connection(
      :adapter  =&amp;gt; "mysql",
      :host     =&amp;gt; "localhost",
      :username =&amp;gt; "root",
      :password =&amp;gt; "",
      :database =&amp;gt; "some_database" 
    )

    class Item &amp;lt; ActiveRecord::Base; end

    server do |map_reduce|
      map_reduce.type = Item
    end

    client do |item|
      logger.info item.id
    end
&lt;/pre&gt;
Now just run:
&lt;pre&gt;
    starfish item.rb
&lt;/pre&gt;
and Starfish takes care of the rest. The code above does the following:

	&lt;ul&gt;
	&lt;li&gt;The server grabs all the items via: &lt;em&gt;Item.find(:all)&lt;/em&gt;&lt;/li&gt;
		&lt;li&gt;Each of the clients grab an item from the collection&lt;/li&gt;
		&lt;li&gt;When there are no more items to be grabbed, everything shuts down&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Just add &lt;span class="caps"&gt;REST &lt;/span&gt;(and it&amp;#8217;s come by default with the Edge Rails) and you&amp;#8217;ll have your own &lt;a href="http://aws.amazon.com/s3"&gt;S3&lt;/a&gt; or GDrive for free ;)&lt;/p&gt;

</description>
      <pubDate>Mon, 21 Aug 2006 00:03:00 PDT</pubDate>
      <guid>&lt;a href="/articles/2006/08/21/mapreduce-for-ruby-ridiculously-easy-distributed-programming"&gt;MapReduce for Ruby: Ridiculously Easy Distributed Programming&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2006/08/21/mapreduce-for-ruby-ridiculously-easy-distributed-programming"&gt;MapReduce for Ruby: Ridiculously Easy Distributed Programming&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
