<?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>Merbist &#187; rails</title>
	<atom:link href="http://merbist.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://merbist.com</link>
	<description>Random thoughts of a software developer</description>
	<lastBuildDate>Tue, 03 Jan 2012 02:34:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Deploying a Rails 3.1 app &#8211; gotchas</title>
		<link>http://merbist.com/2011/08/30/deploying-a-rails-3-1-app-gotchas/</link>
		<comments>http://merbist.com/2011/08/30/deploying-a-rails-3-1-app-gotchas/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 01:20:34 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=1115</guid>
		<description><![CDATA[Recently I had to build a new app as part of my research &#38; development job at LivingSocial. My goal was to get the app up and running in just a few weeks, solid application architecture and graphic design included. When you need to build an app quickly and you want it to have some [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to build a new app as part of my research &amp; development job at <a href="http://livingsocial.com" target="_blank">LivingSocial</a>. My goal was to get the app up and running in just a few weeks, solid application architecture and graphic design included.<br />
When you need to build an app quickly and you want it to have some solid foundations, Rails is quite useful.<br />
I used Rails 3.1RCx so if we would to keep my app and push it to production, the engineering team wouldn&#8217;t have to update it and the transition should be seamless. I also quite like <a href="http://jashkenas.github.com/coffee-script/" target="_blank">CoffeeScript</a> and the app being quite heavy on JavaScript, the choice was easy. Furthermore, my coworker <a title="Bruce Williams" href="http://codefluency.com/" target="_blank">Bruce Williams</a> is a fan of <a title="SCSS" href="http://sass-lang.com/" target="_blank">SCSS</a> and he&#8217;s writing a <a href="http://pragprog.com/" target="_blank">PragProg</a> book called &#8220;The Rails View&#8221; with other LivingSocialist: <a href="http://www.boboroshi.com/" target="_blank">John Athayde</a>. So you got the point, I&#8217;m using Rails3.1, but this post is about the challenges I faced when it was time to deploy and the solutions I found.</p>
<p>I&#8217;ll skip the intro to Rails 3.1 and how to use the new asset pipeline, refer to the <a title="Asset Pipeline" href="http://guides.rubyonrails.org/asset_pipeline.html" target="_blank">Rails guide</a> or one of the mainly posts referenced in t<a href="http://jasonrudolph.com/blog/2011/06/06/helpful-resources-for-upgrading-to-rails-3-1/" target="_blank">his post</a> (if I had properly read the <a href="http://guides.rubyonrails.org/asset_pipeline.html" target="_blank">guide</a>, it would have saved me some valuable time, trust me, read it carefuly).</p>
<p>At that point last night, I had my app working great locally, Bruce created some awesome scss code using mixins and nested rules, the HTML was clean and working great, my <a href="http://jashkenas.github.com/coffee-script/" target="_blank">CoffeeScript</a> was brewing nicely, all was great until I tried to deploy to our QA environment.</p>
<h3>JavaScript runtime dependency</h3>
<p>The first thing you will notice is that you need the proper JavaScript runtime so the asset pipeline works properly. Not a big deal, you&#8217;ll find a lot of documentation about that. The problem is that you need to update your production environment or use depend on gem that will compile the required runtime (sounds dirty to me). So if you are deploying to many machines and you are using an image solution (EC2 AMI or other), you will need to update your image or spin new instances via updated chef/puppet recipes. In this case, the awesome team at LivingSocial had an image ready for me, so that wasn&#8217;t a big deal, but still, you need to take that in consideration as you are planning to update.</p>
<p>So the asset pipeline optimizes your asset management by processing/compiling asset files for you and optimizing their delivery. Instead of serving static files directly via public/images or public/javascripts you know serve them via the asset pipeline which will take care of compiling your CoffeeScript, grouping and minifying your JS and preprocessing all sorts of format. It also optimizes the caching process by giving a unique filename to each file based on the file metadata and gziping files. This is great, but you really, really, really don&#8217;t want to have your apps take care of that in production. Why wasting precious resources to serve assets when they can be prepared ahead of time. (by making Rails serve static assets, you are seriously reducing the throughput of  your app, please think of the children (or the dolphins/trees if you don&#8217;t like children))</p>
<h3>Capistrano</h3>
<p>Rails obviously has a preprocessor available as a rake task and you should update your deployment recipe to use that new feature. Here is my Capistrano code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">after <span style="color:#996600;">'deploy:update_code'</span>, <span style="color:#996600;">'deploy:compile_assets'</span>
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  task <span style="color:#ff3333; font-weight:bold;">:compile_assets</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    run <span style="color:#996600;">&quot;cd #{release_path}; RAILS_ENV=production rake assets:precompile&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Well, my real code doesn&#8217;t hardcode the RAILS_ENV constant value, it&#8217;s in fact set in each env file, but I simplified it since most people only use 1 env outside of dev &amp; test.</p>
<p>What that will do is compile all the files and dump them in public/assets/. But the file I had called bubble.png now becomes bubble-27543c671a3ab45141ee0d3216085009.png which means that my app is totally broken because images use in Bruce SCSS don&#8217;t load, my js files don&#8217;t load and the app is totally broken. Now this is least fun part, that I wish I had known before. This is where you go back and change your code so it uses magic to get the right file names.</p>
<h3>Images</h3>
<p>Fixing images was actually quite simple, in all my views, I just had to make sure I was using the image_tag helper everywhere.</p>
<h3>CSS</h3>
<p>SCSS files were a bit more tricky, I had to use the new scss preprocessor helpers you will find in the <a href="http://guides.rubyonrails.org/asset_pipeline.html" target="_blank">Rails guide</a> (image_path and image_url). I first looked into using erb, but turned out it wasn&#8217;t needed and the end result is much cleaner.</p>
<h3>Javascript/CoffeeScript</h3>
<p>For the CoffeeScript files, I was referring to image assets in the code and of course all the links were broken. So I had to use ERB in my coffee which looked funky but it worked.</p>
<p>But to get that to work, you need to rename your coffee script and append erb at the end. For instance my feature.js.coffee script had to be renamed feature.js.coffee.erb. That made me cry a little inside, but oh well, at least its not a XML config file. Maybe soon we will start seeing code in filenames or filenames called my_feature.js.compressed.minified.coffee.erb.from_rails.mattetti.org<br />
Also, be careful about the order of the file extensions, otherwise it won&#8217;t work. I thought I was done, ready to deploy my apps and this time the assets will show up properly. Turns out I was wrong <img src='http://merbist.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<h3>Rails asset precompilation env specific configuration.</h3>
<p>My css looked good, the precompiling task had run fine but I was missing some js files. I scratched my head as I could only see some of my js files. I then realized that all my JS files were there but some of my CoffeeScript files were missing. The answer was given to me by Bruce who asked me if I had updated my &#8220;config.assets.precompile&#8221; setting. Sometimes I feel that Rails is trying to compete with Struts and here I was really surprised that by default Rails, in production mode only precompiles all static JS and application.js files, but none of the other dynamic js files. Now it does precompile all the scss files, but for a reason I just don&#8217;t understand, it&#8217;s not the case for the JS files. So, you have to go edit production.rb in the config/environments folder and add the other js files you would like Rails to precompile for you.</p>
<p>After making all these changes, I was able to redeploy my app and everything was working again. (you might want to tweak your apache/nginx config as explained in the <a href="http://guides.rubyonrails.org/asset_pipeline.html" target="_blank">Rails guide</a>)</p>
<p>&nbsp;</p>
<h3>Conclusion</h3>
<p>Don&#8217;t be fooled like me and expect that because you have an app running locally, deployment will work right away. Make sure to read about the new features and what&#8217;s needed. Overall, I think that the asset pipeline is a nice addon to Rails and if you don&#8217;t feel like using it, just can put/leave all your files in the public folder and everything will work just like before. I do have to say that I was surprised to see that even in a brand new Rails 3.1 project, Rails isn&#8217;t running in threaded mode by default. But that&#8217;s a different (old) story and I guess people still get more excited about asset management than framework raw performance <img src='http://merbist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2011/08/30/deploying-a-rails-3-1-app-gotchas/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Discussion with a Java switcher</title>
		<link>http://merbist.com/2010/08/22/discussion-with-a-java-switcher/</link>
		<comments>http://merbist.com/2010/08/22/discussion-with-a-java-switcher/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 01:18:55 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=796</guid>
		<description><![CDATA[discussion with an ex-java developer about why the Ruby community is not as he wish it was and why code is not focusing on what he thinks is important. ]]></description>
			<content:encoded><![CDATA[<p>For the past 6 months, I have had regular discussions with an experienced Java developers who switched to Ruby a couple years ago. Names have been changed to protect the guilty but to help you understand my friend &#8216;Duke&#8217; better, you need to know that he has been a developer for 10 years and lead many complicated, high traffic projects. He recently released two Ruby on Rails projects and he has been fighting with performance issues and scalability challenges.</p>
<p>Duke is a happy Ruby developer but he sometimes has a hard time understanding why things are done in a certain way in the Ruby community. Here are some extracts from our conversations. My answers are only based on my own experience and limited knowledge. They are probably not shared by the entire  community, feel free to use the comment section if you want to add more or share your own answers.</p>
<h2>Threads / Concurrency</h2>
<p><strong>Duke:</strong> Why does the Ruby community hate threads so much. It seems to be a taboo discussion and the only answer I hear is that threads are hard to deal with and that Ruby does not have a good threading implementation. What&#8217;s the deal there? If you want concurrent processing, threads are important!</p>
<p><strong>Me:</strong> This is a very good question and I think there are two main reasons why threads and thread safety are not hot topics in the Ruby world. First, look at Ruby&#8217;s main implementation itself. If you are using an old version of Ruby (pre Ruby 1.9) you don&#8217;t use native threads but green threads mapping to only 1 native thread. Ilya has a great (yet a bit old) <a href="http://www.igvita.com/2008/11/13/concurrency-is-a-myth-in-ruby/" target="_blank">blog post explaining the difference</a>, why it matters and also the role and effect of the Global Interpreter Lock (GIL). Also, even though Rubyists like to say that they live in the edge, most of them still use Ruby 1.8 and therefore don&#8217;t really see the improvements in Ruby 1.9 nor yet understand the potential of <a href="http://ruby-doc.org/core-1.9/classes/Fiber.html" target="_blank">fibers</a>.</p>
<p>The other part of the explanation is that the Rails community never really cared until recently. Yehuda Katz recently wrote a <a href="http://yehudakatz.com/2010/08/14/threads-in-ruby-enough-already/" target="_blank">good article on thread safety</a> in Ruby and if you read his post and <a href="http://dpaste.de/5xyG/raw/" target="_blank">Zed Shaw&#8217;s comment</a> you will understand a bit better the historical background. As a matter of fact, the current version of Rails is not multi-threaded by default and developers interested in handling concurrent requests in one process should <a href="http://api.rubyonrails.org/classes/Rails/Configuration.html#M002069" target="_blank">turn on this option</a>. Thread safety appeared for the first time in Rails 2.2 but from what I saw, most people still don&#8217;t enable this option. There are many reasons for that. First, enabling thread safety disables some Rails features like automatic dependency loading after boot and code reloading. A lot of Rails developers take these two features for granted and don&#8217;t understand that they are technically &#8220;hacks&#8221; to make their lives easier. I do believe a lot of Rails developers don&#8217;t understand how threads, thread safety, concurrency, blocking IO and dependencies work. They care about getting their app done and meet their deadlines. They usually use and know Rails without paying too much attention to how Rails extends Ruby. Imagine what would happen if their code wasn&#8217;t thread safe and Rails wasn&#8217;t not using a global lock by default. Now you see why things are not exactly as you expect and also why some Rubyists are getting excited about new projects like <a href="http://nodejs.org/" target="_blank">node.js</a> which takes a different approach.</p>
<p>The other thing to keep in mind is that at least 90 to 95% of the Rails apps out there don&#8217;t get more than a dozen requests/second (a million requests/day). You can scale that kind of load pretty easily using simple approaches like caching,  optimize your DB queries, load balancing to a couple servers. As a matter of fact, compared to the amount of people using Rails on a daily basis, only a very little amount of people are struggling with performance and scalability like you do. This is not an excuse but that explains why these people don&#8217;t care about the things you care about.</p>
<h2>Rails is slow</h2>
<p><strong>Duke:</strong> I don&#8217;t understand why Rails developers are not more concerned about the speed/performance penalty induced by Rails.</p>
<p><strong>Me:</strong> Again, Rails is fast enough for the large majority of developers out there. As you know, as a developer you have to always make compromises. The Rails team always said that development time is more expensive than servers and therefore the focus is on making development easier, faster and more enjoyable. However to get there, they have to somewhat sacrifice some performance. What can be totally unacceptable for you is totally fine for others and your contribution is always welcome. This is probably the root cause of the things you don&#8217;t like in Rails. Rails was built for startups, by startup developers and you don&#8217;t fall in this category. People contributing new features and fixes are the people using Rails for what it is designed to do. There is no real &#8216;Enterprise&#8217; support behind Rails and that might be why you feel the way you feel. Since you find yourself questioning some key Rails conventions and you are struggling with missing features, it looks  to me that you chose the wrong tool for the job since you don&#8217;t even use 70% of the Rails features and are dreaming of things such 3 tier architecture. <a href="http://sinatrarb.com" target="_blank">Sinatra</a> might be a better fit for you if you want lower level control, less conventions and less built-in features.</p>
<h2>Object allocation / Garbage Collection</h2>
<p><strong>Duke:</strong> I recently read that Twitter was spending <a href="http://blog.evanweaver.com/articles/2009/10/21/object-allocations-on-the-web/" target="_blank">20% of its request cycles in the GC</a>, am I the only finding that concerning?</p>
<p><strong>Me:</strong> Most people don&#8217;t realize how the GC works and what it means to allocate objects since Ruby does that automatically. But at the same time, most of these people don&#8217;t really see the affect of the Garbage Collection since they don&#8217;t have that much traffic or they scale in ways that just skips their Ruby stack entirely. (Or they just blame Ruby for being slow)</p>
<p>If you are app deals with mainly reads/GET requests, using HTTP caching (Rails has that built-in) and something like Varnish/<a href="http://rtomayko.github.com/rack-cache/" target="_blank">Rack-cache</a> will dramatically reduce the load on your server apps. Others don&#8217;t investigate their issues and just add more servers. As mentioned in a <a href="http://merbist.com/2010/07/29/object-allocation-why-you-should-care/" target="_blank">previous post</a>, some libraries like Builder are allocating LOTS more objects than others (Nokogiri), use the existing debugging tools to see where your object allocations occur and try to fix/workaround these. In other words, Ruby&#8217;s GC isn&#8217;t great but by ignoring its limitations, we made things even worse. My guess is that the GC is going to improve (other implementations already have better GCs) and that people will realize that Ruby is not magic and critical elements need to be improved.</p>
<h2>Tools</h2>
<p><strong>Duke:</strong> I really have a hard time finding good tools to help scale my apps better and understand where I should optimize my code.</p>
<p><strong>Me: </strong>It is true that we area lacking tools but things are changing. On top of the built-in tools like <a href="http://ruby-doc.org/core-1.9/classes/ObjectSpace.html" target="_blank">ObjectSpace</a>, <a href="http://ruby-doc.org/core-1.9/classes/GC/Profiler.html" target="_blank">GC::Profiler</a>, people interested in performance/debugging are working to provide the Ruby community with their expertise, look at <a href="http://memprof.com/" target="_blank">memprof</a> and <a href="http://rubyforge.org/projects/ruby-debug/" target="_blank">ruby-debug</a> for instance. Of course you can also use tools such as <a href="http://ruby-prof.rubyforge.org/" target="_blank">Ruby-prof</a>, <a href="http://kcachegrind.sourceforge.net/html/Home.html" target="_blank">Kcachegrind</a>, <a href="http://valgrind.org/" target="_blank">Valgrind</a> and <a href="http://www.gnu.org/software/gdb/" target="_blank">GDB</a>. (1.9.2 was <a href="http://github.com/yugui/ruby/tree/feature/dtrace" target="_blank">scheduled to have DTrace support</a> but I did not check yet). Maybe you should be more explicit about what tools you miss and how we could solve the gap.</p>
<h2>ActiveRecord</h2>
<p><strong>Duke:</strong> ActiveRecord doesn&#8217;t do what I need. How come there is no native support for master/slave DBs, sharding, DB view support is buggy,  suggested indexes on queries is not built-in and errors are not handled properly (server is gone, out of sync etc..)?</p>
<p><strong>Me:</strong> You don&#8217;t have to use ActiveRecord, you could use any ORM such as <a href="http://sequel.rubyforge.org/" target="_blank">Sequel</a>, <a href="http://datamapper.org/" target="_blank">DataMapper</a> or your own. But to answer your question, I think that AR doesn&#8217;t do everything you want because nobody contributed these features to the project and the people maintaining ActiveRecord don&#8217;t have the need for these features.</p>
<h2>What can we do?</h2>
<p>We, as a community, need to realize that we have to learn from other communities and other programming languages, this kind of humorous graph is unfortunately not too far from reality.</p>
<p style="text-align: center;"><img class="aligncenter" title="Programmer Hierarchy" src="http://i.imgur.com/G7WyP.gif" alt="" width="500" height="1105" /></p>
<p>Bringing your expertise and knowledge to the Ruby community is important. Looking further than just our own little will push us to improve and fulfill the gaps. Let the community know what tools you are missing, the good practices you think we should be following etc&#8230;</p>
<p>Take for instance <a href="http://nodejs.org/" target="_blank">Node.js</a>, it&#8217;s a port of <a href="http://wiki.github.com/eventmachine/eventmachine/" target="_blank">Ruby&#8217;s EventMachine</a> / <a href="http://twistedmatrix.com/trac/" target="_blank">Python&#8217;s twisted</a>. There is no reasons why the Ruby or Python versions could not do what the Javascript version does. However people are getting excited and are jumping ship. What do we do about that? One way would be to identify what makes node more attractive than EventMachine and what needs to be done so we can offer what people are looking for. I asked this question a few weeks ago and the response was that a lot of the Ruby libraries are blocking and having to check is too bothersome. Maybe that&#8217;s something that the community should be addressing. Node doesn&#8217;t have that many libraries and people will have to write them, in the mean time we can make our libs non-blocking. Also, let&#8217;s not forget that this is not a competition and people should choose the best tool for their projects.</p>
<p>Finally, things don&#8217;t change overnight, as more people encounter the issues you are facing, as we learn from others, part of the community will focus on the problems you are seeing and things will get better. Hopefully, <strong>you</strong> will also be able to contribute and influence the community to build an even better Ruby world.</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2010/08/22/discussion-with-a-java-switcher/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Ruby object allocation &amp; why you should care</title>
		<link>http://merbist.com/2010/07/29/object-allocation-why-you-should-care/</link>
		<comments>http://merbist.com/2010/07/29/object-allocation-why-you-should-care/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 07:47:50 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=785</guid>
		<description><![CDATA[Recently I was tasked with finding how to optimize a web application with heavy traffic. The application (a Rails 2.3.x app) gets about 3 million requests per hour and most of these requests cannot really be easily cached so they go through the entire stack. This is probably not the case of most web apps [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was tasked with finding how to optimize a web application with heavy traffic. The application (a Rails 2.3.x app) gets about 3 million requests per hour and most of these requests cannot really be easily cached so they go through the entire stack.</p>
<p>This is probably not the case of most web apps out there. None the less, my findings my help you understand Ruby better and maybe think differently about memory management.</p>
<p>This is certainly not an advanced GC blog post, I will try to keep it as simple as possible. My goal is to show you how Ruby memory allocation works and why it can affect your app performance and finally, how can you avoid to allocate to many objects.</p>
<h2>Ruby memory management.</h2>
<p>Rubyists are quite lucky since they don&#8217;t have to manage the memory themselves. Because developers are lazy and Matz developed his language for people and not machine, memory is managed &#8220;magically&#8221;. Programming should be fun and managing memory isn&#8217;t really considered fun (ask video game developers or iOS programmers <img src='http://merbist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).</p>
<p>So in Ruby, the magical memory management is done by a Garbage Collector. The GC&#8217;s job is to run and free objects that were previously allocated but not used anymore. Without a GC we would saturate the memory available on the host running the program or would have to deallocate the memory manually. Ruby&#8217;s GC uses a conservative, stop the world, mark-and-sweep collection mechanism.  More simply, the garbage collection runs when the allocated memory for the process is maxed out. The GC runs and blocks all code from being executed and will free unused objects so new objects can be allocated.</p>
<p>Joe Damato did a great talk on that matter during last RailsConf</p>
<p><a style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;" title="View Garbage Collection and the Ruby Heap on Scribd" href="http://www.scribd.com/doc/32718051/Garbage-Collection-and-the-Ruby-Heap">Garbage Collection and the Ruby Heap</a> <object id="doc_74911371900314" style="outline: none;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="doc_74911371900314" /><param name="data" value="http://d1.scribdassets.com/ScribdViewer.swf" /><param name="wmode" value="opaque" /><param name="bgcolor" value="#ffffff" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="FlashVars" value="document_id=32718051&amp;access_key=key-1hl4d18vocqmc9ilk9a&amp;page=1&amp;viewMode=slideshow" /><param name="src" value="http://d1.scribdassets.com/ScribdViewer.swf" /><param name="allowfullscreen" value="true" /><param name="flashvars" value="document_id=32718051&amp;access_key=key-1hl4d18vocqmc9ilk9a&amp;page=1&amp;viewMode=slideshow" /><embed id="doc_74911371900314" style="outline: none;" type="application/x-shockwave-flash" width="100%" height="500" src="http://d1.scribdassets.com/ScribdViewer.swf" flashvars="document_id=32718051&amp;access_key=key-1hl4d18vocqmc9ilk9a&amp;page=1&amp;viewMode=slideshow" allowscriptaccess="always" allowfullscreen="true" bgcolor="#ffffff" wmode="opaque" data="http://d1.scribdassets.com/ScribdViewer.swf" name="doc_74911371900314"></embed></object></p>
<p>The problem is that Ruby&#8217;s GC was not designed to support hundred thousand objects allocation per second. Unfortunately, that&#8217;s exactly what frameworks like Ruby on Rails do, and you might contribute to the problem too without even knowing it.</p>
<h2>Does it really matter?</h2>
<p>I believe it does. In my case improving the object allocation means much better response time, less servers, less support and less headaches. You might think that servers are cheaper than developers. But more servers mean more developer time spent fixing bugs and more IT support. That&#8217;s why I think, memory management is something Ruby developers should be aware of and should take in consideration, especially the ones writing frameworks, libraries or shared code.</p>
<p>I am using Ruby 1.9 so I could not profile my Rails 2.x app using <a href="http://memprof.com/" target="_blank">memprof</a>, instead I wrote a <a href="http://github.com/mattetti/GC-stats-middleware" target="_blank">simple and basic middleware</a> that keeps track of the memory allocation/deallocation and GC cycles during a web request (Ruby1.9 only). One of my simple Rails2 actions (1 DB call, simple view) is allocating 170,000 objects per requests. Yes, you read right: 170k objects every single request. At 3 million requests/hour, you can imagine that we are spending a LOT of time waiting for the GC. This is obviously not 100% Rails fault as I am sure our code is contributing to the problem. I heard from the memprof guys that Rails was allocating 40k objects. I decided to check Rails3.</p>
<p>After warming up, a basic <span style="text-decoration: underline;">Rails3</span> &#8216;hello world&#8217; app clocks at about <strong>8,500 objects allocated per request</strong>, forcing the GC to run more or less every 6 requests. On my machine (mac pro) the GC takes about 20ms to free the objects. A <span style="text-decoration: underline;">Rack</span> &#8216;hello world&#8217; app clocks at <strong>7 objects</strong> per request and a <span style="text-decoration: underline;">Sinatra</span> app at <strong>181 objects</strong>. Of course you can&#8217;t really compare these different libraries/frameworks but that gives you an idea of the price you pay to get more features.</p>
<p>One thing to remember is that the more objects you allocate, the more time you &#8220;lose&#8221; at code execution. For more developers, it probably doesn&#8217;t matter much, but if you should still understand that concept especially if you decide to contribute to the OSS community and offer patches, libraries, plugins etc&#8230;</p>
<h1>What can I do?</h1>
<p>Be aware that you are allocating  objects, for instance something as simple as 100.times{ &#8216;foo&#8217; } allocates 100 string objects (strings are mutable and therefore each version requires its own memory allocation).</p>
<p>Make sure to evaluate the libraries you use, for instance switching a Sinatra XML rendering action from Builder to Nokogiri XML Builder saved us about 12k object allocations (Thanks Aaron Patterson). Make sure that <strong>if </strong>you are using a library allocating a LOT of objects, that other alternatives are not available and your choice is worth paying the GC cost. (you might not have a lot of requests/s or might not care for a few dozen ms per requests). You can use memprof or one of the many existing tools to check on the GC cycles using load tests or in dev mode. Also, be careful to analyze the data properly and to not only look at the first request. <a href="http://twitter.com/akeem" target="_blank">Someone</a> sent me <a href="http://memprof.com/dump/4c52503c7fdeb62cff000001" target="_blank">this memory dump</a> from a Rails3 &#8216;hello world&#8217; with Ruby 1.8.7 and it shows that Rails is using <a href="http://memprof.com/dump/4c52503c7fdeb62cff000001/detail?where=%7B%7D">331973 objects</a>.  While this is totally true, it doesn&#8217;t mean that 330k objects are created per request. Instead that means that 330k objects are currently in memory. Rubygems loading already allocate a lot of objects, Rails even more but these objects won&#8217;t be GC&#8217;d and don&#8217;t matter as much as the ones allocated every single request. The total amount of memory used by a Ruby process isn&#8217;t that important, however the fluctuation forcing the GC to run often is. This is why my middleware only cares about the allocation change during a request. (The GC should still traverse the entire memory so, smaller is better)</p>
<p>The more object allocation you do at runtime/per request, the more the GC will need to run, the slower your code will be. So this is not a question of memory space, but more of performance. If your framework/ORM/library/plugin allocates too many objects per request maybe you should start by reporting the problem and if you can, offer some patches.</p>
<p>Here are some hints about memory allocation:</p>
<p>Creating a hash object really allocates more than an object, for instance {&#8216;joe&#8217; =&gt; &#8216;male&#8217;, &#8216;jane&#8217; =&gt; &#8216;female&#8217;} doesn&#8217;t allocate 1 object but 7. (one hash, 4 strings + 2 key strings) If you can use symbol keys as they won&#8217;t be garbage collected. However because they won&#8217;t be GC&#8217;d you want to make sure to not use totally dynamic keys like converting the username to a symbol, otherwise you will &#8216;leak&#8217; memory.</p>
<p>Looking at a GC cycle in the Rails3 hello world example shows what objects get deallocated:</p>
<blockquote><p>GC run, previous cycle was 6 requests ago.</p>
<p>GC 203 invokes. (amount of cycles since the program was started)<br />
Index   1</p>
<p>Invoke Time(sec)   25.268</p>
<p>Use Size(byte)   4702440</p>
<p>Total Size(byte)   7307264</p>
<p>Total Object   182414</p>
<p>GC Time(ms) 22.35600000000204090611</p>
<p>## 56322 freed objects. ##<br />
<strong>[78%] 44334 freed strings.</strong><br />
<strong>[7%] 4325 freed arrays.</strong><br />
[0%] 504 freed bignums.<br />
[1%] 613 freed hashes.<br />
[0%] 289 freed objects.<br />
<strong>[5%] 3030 freed parser nodes (eval usage).</strong></p></blockquote>
<p>I did not list all the object types but it&#8217;s pretty obvious that the main issue in the case of Rails is string allocation. To a certain extend the allocated arrays and the runtime use of eval are not helping either. (what is being eval&#8217;d at runtime anyway?)</p>
<p>If you use the same string in various place of you code, you can &#8220;cache&#8221; them using a local var, instance variable, class variable or constant. Sometimes you can just replaced them by a symbol and save a few allocations/deallocations per request. Whatever you do tho, make sure there is a real need for it. My rule of thumb is that if some code gets exercised by 80% of the requests, it should be really optimized and avoid extra allocations so the GC won&#8217;t slow us down.</p>
<h2>What about a better GC?</h2>
<p>That&#8217;s the easy answer. When I mentioned this problem with Rails, a lot of people told me that I should use JRuby or Rubinius because their GC were much better. Unfortunately, that&#8217;s not that simple and choosing an alternative implementation requires much further research and tests.</p>
<p>But what annoys me with this solution is that using it is not solving the issue, it&#8217;s just working around it. Yes, Ruby&#8217;s GC isn&#8217;t that great but that&#8217;s the not the key issue, <strong>the key issue is that some libraries/frameworks allocate way too many objects</strong> and that nobody seems to care (or to even know it). I know that the Ruby Core Team is working on some optimizations and I am sure Ruby will eventually get an improved GC. In the meantime, it&#8217;s easy to blame Matz, Koichi and the rest of the core team but again, it&#8217;s ignoring that the root cause, totally uncontrolled memory allocation.</p>
<p><strong>Maybe it&#8217;s time for us, Rubyists, to think a bit more about our memory usage.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2010/07/29/object-allocation-why-you-should-care/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Au Revoir Rails community</title>
		<link>http://merbist.com/2010/06/04/au-revoir-rails-community/</link>
		<comments>http://merbist.com/2010/06/04/au-revoir-rails-community/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 01:45:20 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=776</guid>
		<description><![CDATA[Time really flies! Back in December 2005, Ruby on Rails 1.0 was released to the masses. I remember that was when I first got interested in Rails. Six months later, I was doing Rails development full time. Rails pushed me to contribute to the project, to write plugins, to improve my Ruby knowledge, to release [...]]]></description>
			<content:encoded><![CDATA[<p>Time really flies!</p>
<p>Back in December 2005, Ruby on Rails 1.0 was released to the masses. I remember that was when I first got interested in Rails. Six months later, I was doing Rails development full time.</p>
<p>Rails pushed me to contribute to the project, to write plugins, to improve my Ruby knowledge, to release gems and to become a better engineer overall. I then joined the <a href="http://merbivore.com" target="_blank">Merb project</a>, focusing on problems I was facing in the various client projects I had back then.</p>
<p>The competition between Rails and Merb turned into a constant confrontation, splitting the Ruby community into two camps. A resolution was later achieved by merging the two teams and focusing our energy on Rails 3. This is how I became a part of the Activism team with <a href="http://blog.envylabs.com/" target="_blank">Gregg</a> and <a href="http://railscasts.com/" target="_blank">Ryan</a>. In this new role I was given the opportunity to meet lots of different people from various backgrounds and different communities. I really had a lot of fun.</p>
<p>However, things have changed for me. I won&#8217;t be at Rails Conf 2010 because in a few weeks I will become a father for the first time. And with that, an obvious priority shift. My day job working on <a title="ModNation" href="http://community.modnation.com/" target="_blank">Playstation games</a> is also quite time consuming and the little free time I manage to get to work on my own projects is spent on my <a title="MacRuby Book" href="http://macruby.labs.oreilly.com/" target="_blank">MacRuby book</a>. The disconnect between the Rails community and myself is probably more evident now than ever. The challenges encountered by most Railists are so different from the ones I face daily that I think others would do a much better job than I at advocating for Rails. So this is why I believe it&#8217;s time for me to step away from the Rails community, kick back and relax (and get ready to change a lot of diapers).</p>
<p>This is an &#8220;<a href="http://www.merriam-webster.com/dictionary/au+revoir" target="_blank">au revoir</a>&#8220;, not an &#8220;<a href="http://www.merriam-webster.com/dictionary/adieu" target="_blank">Adieu</a>&#8220;. I will continue to keep an eye on Rails 3 and the fast growing ecosystem.</p>
<p>I will still be writing Ruby for a living and will hopefully keep contributing to the projects I use. And I plan to keep on attending to Ruby conferences around the world just as soon as my kid is old enough to travel with me <img src='http://merbist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Finally, with the imminent release of Rails 3, I hope to see even more people stand up and advocate for Ruby on Rails the way Gregg Pollack, Ryan Bates and many others have done so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2010/06/04/au-revoir-rails-community/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Ruby, Rack and CouchDB = lots of awesomeness</title>
		<link>http://merbist.com/2009/07/27/ruby-rack-and-couchdb-lots-of-awesomeness/</link>
		<comments>http://merbist.com/2009/07/27/ruby-rack-and-couchdb-lots-of-awesomeness/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 21:49:20 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[merb]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[railssummit]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=536</guid>
		<description><![CDATA[Over the weekend, I spent some time working on a Ruby + Rack +CouchDB project. Three technologies that I know quite well but that I never put to work together at the same time, at least not directly.  Let&#8217;s call this Part I. Before we get started, let me introduce each component: Ruby : if [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend, I spent some time working on a Ruby + Rack +CouchDB project. Three technologies that I know quite well but that I never put to work together at the same time, at least not directly.  Let&#8217;s call this Part I.</p>
<p>Before we get started, let me introduce each component:</p>
<ul>
<li><a id="aptureLink_uhrplaQzyi" href="http://en.wikipedia.org/wiki/Ruby%20%28programming%20language%29">Ruby</a> : if you are reading this blog, you more than likely know at least a little bit about, what I consider, one of the most enjoyable programming language out there. It&#8217;s also a very flexible language that lets us do some interesting things. I could have chosen Python to do the same project but that&#8217;s a whole different topic. For this project we will do something Ruby excels at: reopening existing classes and injecting more code.</li>
<li><a id="aptureLink_2DDeKXxZsP" href="http://rack.rubyforge.org/">Rack</a>: a webserver interface written in Ruby and inspired by <a id="aptureLink_Jchqx9HIiw" href="http://www.wsgi.org/wsgi/">Python&#8217;s WSGI</a>. Basically, it&#8217;s a defined API to interact between webservers and web frameworks. <span style="color: #000000;">It&#8217;s used by most common Ruby web frameworks, from Sinatra to Rails</span> (btw, Rails3 is going to be even more Rack-focused than it already is). So, very simply put, the webserver receives a request, passes it to Rack, that converts it, passes it to your web framework and the web framework sends a response in the expected format (more on Rack later).</li>
<li><a id="aptureLink_LN4oL6D0oH" href="http://couchdb.apache.org/">CouchDB</a>: Apache&#8217;s document-oriented database. RESTful API, schema-less, written in Erlang with built-in support for map/reduce. For this project, I&#8217;m using <a id="aptureLink_tlTW2NkUta" href="http://github.com/mattetti/couchrest">CouchRest</a>, a Ruby wrapper for Couch.</li>
</ul>
<h2>Goal: Log Couch requests and analyze data</h2>
<p>Let&#8217;s say we have a Rails, Sinatra or Merb application and we are using CouchRest (maybe we are using CouchRest and ActiveRecord, but let&#8217;s ignore that for now).</p>
<p>Everything works fine but we would like to profile our app a little and maybe optimize the DB usage. The default framework loggers don&#8217;t support Couch. The easy way would be to tail the Couch logs or look at the logs in <a id="aptureLink_W2ygfTNmX0" href="http://janl.github.com/couchdbx/">CouchDBX</a>. Now, while that works, we can&#8217;t really see what DB calls are made per action, so it makes any optimization work a bit tedious. (Note that Rails3 will have some better conventions for logging, making things even easier)</p>
<p>So, let&#8217;s see how to fix that. Let&#8217;s start by looking at Rack.</p>
<h2>Rack Middleware</h2>
<p>Instead of hacking a web framework specific solution, let&#8217;s use Rack. Rack is dead simple, you just need to write a class that has a <em>call</em> method.<br />
<script src="http://gist.github.com/155420.js"></script> In our case, we don&#8217;t care about modifying the response, we just want to instrument our app. We just want our middleware to be transparent and let our webserver deal with it normally.    <script src="http://gist.github.com/155425.js"></script></p>
<p>Here we go &#8230; that wasn&#8217;t hard, was it? We keep the application reference in the @app variable when a new instance of the middleware is created. Then when the middleware is called, we just call the rest of the chain and pretend nothing happened.</p>
<p><script src="http://gist.github.com/155432.js"></script> As you can see, we just added some logging info around the request. Let&#8217;s do one better and save the logs in CouchDB:  <script src="http://gist.github.com/155437.js"></script></p>
<p>Again, nothing complicated. In our rackup file we defined which Couch database to use and we passed it to our middleware (we change our initialize method signature to take the DB).<br />
Finally, instead of printing out the logs, we are saving them to the database.</p>
<p>W00t! At this point all our requests have been saved in the DB with all the data there, ready to be manipulated by some map/reduce views we will write. For the record, you might want to use the bulk_save approach in CouchDB which will wait for X amount of records to save them in the DB all at once. Couch also let&#8217;s you send new documents, but only save it to the DB every X documents or X seconds.</p>
<p><img class="alignnone" title="log document" src="http://img.skitch.com/20090726-ebmpgjtrc6x8239ia69kmri1rt.jpg" alt="" width="715" height="505" /></p>
<p>As you can see, our document contains the timestamps and the full environment as a hash.</p>
<p>All of that is nice, but even though we get a lot of information, we could not actually see any of the DB calls made in each request. Let&#8217;s fix that and inject our logger in CouchRest (you could apply the same approach to any adapter).</p>
<p>Let&#8217;s reopen the HTTP Abstraction layer class used by CouchRest and inject some instrumentation:</p>
<p><script src="http://gist.github.com/155442.js"></script></p>
<p>Again, nothing fancy, we are just opening the module, reopening the methods and wrapping our code around the <em>super</em> call (for those who don&#8217;t know, <em>super</em> calls the original method).</p>
<p>This is all for Part I. In Part II, we&#8217;ll see how to process the logs and make all that data useful.</p>
<p>By the way, if you make it to <a id="aptureLink_aF4OSFnjjA" href="http://www.railssummit.com.br/">RailsSummit</a>, I will be giving a talk on Rails3 and the new exciting stuff you will be able to do including Rack based stuff, CouchDB, MongoDB, new DataMapper etc..</p>
<p><a href="http://railssummit.com.br/"><img class="aligncenter" title="RailsSummit 2009" src="http://railssummit.com.br/images/banners/en_souPalestrante_210x60.jpg" alt="" width="210" height="60" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2009/07/27/ruby-rack-and-couchdb-lots-of-awesomeness/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RailsConf 2009</title>
		<link>http://merbist.com/2009/05/08/railsconf-2009/</link>
		<comments>http://merbist.com/2009/05/08/railsconf-2009/#comments</comments>
		<pubDate>Fri, 08 May 2009 20:18:18 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[merb]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[railsconf]]></category>
		<category><![CDATA[vegas]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=487</guid>
		<description><![CDATA[RailsConf 2009 has now finished.  This time last year, no one would have ever guessed that the Merb and Rails teams would join forces and focus on what will hopefully be known as one of the best Web Frameworks. It was encouraging to see so many people excited about what&#8217;s being ported over from Merb [...]]]></description>
			<content:encoded><![CDATA[<p>RailsConf 2009 has now finished.  This time last year, no one would have ever guessed that the Merb and Rails teams would join forces and focus on what will hopefully be known as one of the best Web Frameworks.</p>
<p>It was encouraging to see so many people excited about what&#8217;s being ported over from Merb and the new options available to people who are currently limited by the existing stack. For those interested in pushing Rails further and doing stuff out of the norm, here are my slides. <a href="http://www.workingwithrails.com/person/5919-arthur-zapparoli" target="_blank">Arthur Zapparoli</a> from <a href="http://www.rubyonrails.pro.br/" target="_blank">Brazilian Rails squad</a> recorded most of the talk and told me he will upload the video ASAP. You can also read <a href="http://yehudakatz.com/2009/05/08/railsconf-wrapup/" target="_blank">Yehuda Katz&#8217; blog</a> which covers what he talked about.</p>
<div id="__ss_1396365" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Rails3: Stepping off of the golden path" href="http://www.slideshare.net/mattetti/rails3-stepping-off-of-the-golden-path?type=presentation">Rails3: Stepping off of the golden path</a><object width="425" height="355" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=steppingoffofthegoldenpath-090506154117-phpapp01&amp;rel=0&amp;stripped_title=rails3-stepping-off-of-the-golden-path" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=steppingoffofthegoldenpath-090506154117-phpapp01&amp;rel=0&amp;stripped_title=rails3-stepping-off-of-the-golden-path" /><param name="allowfullscreen" value="true" /></object></p>
<div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/mattetti">Matt Aimonetti</a>.</div>
</div>
<p>It was really great to meet a lot of new people as well as people I only knew via IRC/IM/twitter.</p>
<p>It was a great honor to finally meet <a href="http://twitter.com/dkubb" target="_blank">Dan Kubb</a> (DataMapper), <a href="http://twitter.com/ninh" target="_blank">Ninh Hernandez-Búi</a> &amp; <a href="http://twitter.com/phusion_nl" target="_blank">Hongli McLovin Lai (Phusion)</a>, <a href="http://twitter.com/peterc" target="_blank">Peter Cooper</a> (<a href="http://www.rubyinside.com/" target="_blank">RubyInside</a>), <a href="http://twitter.com/rsim" target="_blank">Raimonds Simanovskis</a> (Oracle adapter for AR), <a href="http://weblogs.java.net/blog/arungupta/" target="_blank">Arun Gupta</a> (Sun/Glassfish),  <a href="http://twitter.com/copiousfreetime" target="_blank">Jeremy Hinegardner</a> (crate), <a href="http://maximilien.org" target="_blank">Michael Maxilien</a> (IBM), Dana Jones (<a href="http://railsbridge.org/" target="_blank">railsbridge</a>), Zach Zolton &amp; Geoff Buesing (CouchRest) and of course the Brazilian crew (lots of awesome .br guys came this year, I&#8217;m looking forward to RailsSummit) and last but not least, the French speaking crew (I&#8217;m glad to see Ruby is picking up back home). (I know I&#8217;m forgetting people&#8230; sorry about that)</p>
<p>It was also really nice to talk with some experts like Dave Astels, Aslak Hellesøy, Rich Kilmer, David Chelimsky, Ryan Brown, Derek Neighbors etc.. to get their feedback on various projects I&#8217;m working on.</p>
<p>Leaving Vegas, I feel like the Rails community is expanding quickly (it was the first RailsConf for 1/4 to 1/5 of the attendees) and that the community is organizing itself to welcome a new audience (better documentation, great initiatives like <a href="http://railsbridge.org/" target="_blank">railsbridge.org</a>, willingness to help), as well as trying to be more available to the &#8216;Enterprise&#8217; world.</p>
<p>These feelings were enforced during our Rails Activism BOF and after talking with 3rd party developers and sponsors really trying to solve problems that newcomers to Rails are now facing. This is an exciting time.</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2009/05/08/railsconf-2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Presenting the Rails Activists</title>
		<link>http://merbist.com/2009/01/05/presenting-the-rails-activists/</link>
		<comments>http://merbist.com/2009/01/05/presenting-the-rails-activists/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 18:15:44 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[activists]]></category>
		<category><![CDATA[evangelism]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[rails 3.0]]></category>
		<category><![CDATA[rails3]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=422</guid>
		<description><![CDATA[Today is Monday. I usually don&#8217;t like Mondays. Being Monday goes with waking up early, going back to work, and lots of deadlines. However, today is a special Monday. It&#8217;s the first Monday of the year and I have a special announcement! During the Rails/Merb merge announcement, it was mentioned that I will be joining [...]]]></description>
			<content:encoded><![CDATA[<p>Today is Monday. I usually don&#8217;t like Mondays.<br />
Being Monday goes with waking up early, going back to work, and lots of deadlines.</p>
<p>However, today is a special Monday. It&#8217;s the first Monday of the year and I have a <strong>special announcement</strong>!</p>
<p>During the Rails/Merb merge announcement, it was mentioned that I will be joining the soon to be created <strong>&#8220;Evangelism team&#8221;</strong>.</p>
<p>A few people asked me what being a <strong>&#8220;Rails Evangelist&#8221;</strong> means. To reassure my parents and close friends, no, <em>I didn&#8217;t join a new cult worshiping locomotives</em>. However, I still think that public transportation should be improved, especially in this time of crisis (but that&#8217;s a different topic).</p>
<p>A technical evangelist, is usually someone who knows and uses a specific technology and thinks others should look into it. This is something I&#8217;ve been doing for Merb while being part of the core team. I initiated and helped organizing MerbCamp, re-did the wiki, started working on the merb-book, spent time looking for and listening to users, spent time with third party developers and people pushing Merb to a new level (YellowPages, Wikimedia and many others).</p>
<p>This interaction with the end users and the third party developers is something the entire Merb team valued a great deal and I always felt it was something the community really appreciated.</p>
<p>As part of the merge, it was agreed that we would push things further and have a team within the Rails team to take care of &#8220;communication&#8221;. Rails is a bigger project than Merb and communication between the dev team and the users isn&#8217;t always something easy to do.</p>
<p>That&#8217;s why we have formed a separate team that will help communicate and support the community better. We now even have <a href="http://rubyonrails.org/activists" target="_blank">an official page on the Rails website</a> itself <img src='http://merbist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>The Rails Activists</h2>
<p><a href="http://merbist.com/wp-content/uploads/2009/01/ateam.jpg"><img class="alignleft size-medium wp-image-423" title="a team" src="http://merbist.com/wp-content/uploads/2009/01/ateam-300x225.jpg" alt="" width="300" height="225" /></a>The A-Team <a href="http://weblog.rubyonrails.org/2009/1/5/announcing-the-rails-activists" target="_blank">just got announced on the Rails blog</a>.</p>
<p>Instead of being called &#8220;evangelists&#8221;, we are going to be called &#8220;activists&#8221;. I think part of the argument was that the E-Team doesn&#8217;t sound as good as the A-Team.</p>
<p>We started with team of 4. You might not know them yet but they all are brilliant people and I&#8217;m really glad to be working with them.</p>
<p><br class="spacer" /><br />
<br class="spacer" /><br />
<br class="spacer" /></p>
<p><img class="alignleft" style="clear:both" title="Gregg Pollack" src="http://weblog.rubyonrails.com/assets/2009/1/4/gregg_pollack.png" alt="" width="90" height="103" /><strong>Gregg Pollack</strong>, from Rails Envy. You might remember Gregg from the Rails vs * commercials or from the Rails Envy podcasts. I&#8217;ve known Gregg for a little while and he&#8217;s someone you can rely on and always full of energy/new ideas.<br class="spacer" /><br />
<br class="spacer" /></p>
<p><img class="alignleft" style="clear:both" title="Ryan Bates" src="http://weblog.rubyonrails.com/assets/2009/1/4/ryan_bates.png" alt="" width="90" height="103" /><strong><br />
Ryan Bates</strong>, mainly known for his Railscasts. I only met Ryan once in person, but I&#8217;ve always been impressed by his work (don&#8217;t tell anyone, but I secretly dreamt of having something like Railscasts but for Merb <img src='http://merbist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br class="spacer" /><br />
<br class="spacer" /></p>
<p><img class="alignleft" style="clear:both" title="Mike Gunderloy" src="http://weblog.rubyonrails.com/assets/2009/1/4/mike_gunderloy.png" alt="" width="90" height="103" /><strong>Mike Gunderloy</strong>. I actually did not know Mike but I have read and enjoyed his <a href="http://afreshcup.com/" target="_blank">blog</a> and have seen his work on the Rails guides. Mike is an experienced writer and developer. He joked the other day saying that he started programming before any member of the Rails team was even born. Mike is a great addition to the team and I&#8217;m looking forward to learning from his experience.<br />
<br class="spacer" /></p>
<p>Gregg and Ryan also covered the event, you might want to check their blog posts (<a href="http://www.railsenvy.com/2009/1/5/the-rails-activist-team" target="_blank">Gregg&#8217;s</a> and <a href="http://afreshcup.com/2009/01/05/announcing-the-rails-activists/" target="_blank">Mike&#8217;s</a>)</p>
<h2 style="clear:both">So what are we going to do?</h2>
<p>Pretty simple. We&#8217;ve boiled it down to 2 sentences:</p>
<blockquote><p>The mission of the Rails Activists is to empower and support the worldwide network of Ruby on Rails users. We do this by publicizing Rails, making adoption easier, and enhancing developer support.</p></blockquote>
<p>if you prefer a few more details, here are some of the tasks we are going to work on:</p>
<ul>
<li>Public Relations with media of all sizes</li>
<li>Ombudsman work to ensure good user-to-user support</li>
<li>Community Leadership at events and conferences</li>
<li>Media Organization to help create good promotional opportunities</li>
<li>Website maintenance</li>
<li>Documentation efforts</li>
<li>Developer support</li>
</ul>
<h2>Do we need help?</h2>
<p><strong>Absolutely!</strong> The idea is not that we are going to do all the work. The concept of this new team is to help organize the community. We are going to build a Rails Network, a network of people involved in local Rails &#8220;evangelism&#8221;/activism, people contributing and/or translating documentation, third part developers etc&#8230;</p>
<p>First thing would be to <a href="http://groups.google.com/group/rails-activism" target="_blank">join the mailing list</a> and share your suggestions, comments, concerns, etc., with us.</p>
<p>Secondly, we have already set up some forums to hear your feedback.</p>
<p>To start off, we are asking people to let us know what they <a href="http://rails.uservoice.com/" target="_blank">would like to see happening in the Rails3 timeframe</a>.<br />
We have other forums for more <a href="http://rails.uservoice.com/pages/general_feedback" target="_blank">general feedback</a>, but we need to work with deadlines so we can prioritize accordingly. Using the Rails3 milestone should help us focus on a short/medium term deadline. <a href="http://rails.uservoice.com/pages/rails_future" target="_blank">Long term and not specific suggestions</a> are welcome in the other forums.</p>
<p>Finally, contact us. You can find multiple ways to do so on the <a href="http://rubyonrails.org/activists" target="_blank">activism team web page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2009/01/05/presenting-the-rails-activists/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>latest Merb and Rails 3.0 news</title>
		<link>http://merbist.com/2008/12/29/latest-merb-and-rails-30-news/</link>
		<comments>http://merbist.com/2008/12/29/latest-merb-and-rails-30-news/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 21:57:38 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[merb]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails 3.0]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=412</guid>
		<description><![CDATA[Foy Savas, author or the &#8220;merb way&#8221; wrote a very well written post on &#8220;Rails monoculture&#8221; Pat Eyler, wrote an article asking if Rails and Merb would be better together. Ben Aldred, tell people to stop worrying and start loving Rails 3. fotonauts.com a Rails and Merb Photo website developed by an ex-apple team, was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://foysavas.com"><img class="alignleft size-medium wp-image-414" title="foy-savas" src="http://merbist.com/wp-content/uploads/2008/12/foy-savas-1.png" alt="" width="200" height="235" /></a></p>
<ul>
<li><a href="http://foysavas.com" target="_blank">Foy Savas</a>, author or the &#8220;<a href="http://my.safaribooksonline.com/9780321601636" target="_blank">merb way</a>&#8221; wrote a very well written <a href="http://www.foysavas.com/blog/2008/12/25/lets-be-clear-the-rails-monoculture-is-over.html" target="_blank">post on &#8220;Rails monoculture&#8221;</a></li>
<li><a href="http://on-ruby.blogspot.com/" target="_blank">Pat Eyler</a>, wrote an article asking if <a href="http://on-ruby.blogspot.com/2008/12/rails-and-merb-better-together.html" target="_blank">Rails and Merb would be better together</a>.</li>
<li><a href="http://www.geekmade.co.uk/" target="_blank">Ben Aldred</a>, tell people to <a href="http://www.geekmade.co.uk/2008/12/stop-worrying-and-start-loving-rails-3/" target="_blank">stop worrying and start loving Rails 3</a>.</li>
<li><span class="entry-content"><a href="http://www.fotonauts.com/" target="_blank">fotonauts.com</a> a Rails and Merb Photo website developed by an ex-apple team, was <a href="http://www.techcrunch.com/2008/12/24/fotonauts-opens-up-a-little-more-skip-the-5000-long-waitlist/" target="_blank">featured in TechCrunch</a>. Fotonauts is the perfect example of an app that will bain a lot from the merge.</span></li>
<li><a href="http://yehudakatz.com" target="_blank">Yehuda</a> has been blogging a lot about every single step and even though most people are enjoying a well deserved break, you can read the <a href="http://yehudakatz.com/2008/12/26/dispatch-from-the-front-lines/" target="_blank">details</a> <a href="http://yehudakatz.com/2008/12/27/status-memorandum/" target="_blank">of</a> the <a href="http://yehudakatz.com/2008/12/29/another-rails-2x3-update/" target="_blank">work</a> started on the merge.</li>
</ul>
<p>Basically, the work started, we are getting familiar with the rails code base and are optimizing things slowly but surely with a focus on testing JRuby. The Merb router is being optimized and ported over to Rails 3.0. Rails and Merb developers will be able to stick to their DSL (so we stay backward compatible). Merb bootloader is also being ported over without breaking the backward compatibility. Finally, ActiveSupport is being broken down in more manageable/independant chunks so people will be able to pick only what they want to use. A &#8220;mini&#8221; version is also on the work.</p>
<ul>
<li><a href="http://yehudakatz.com/2008/12/28/merb-107-release-notes/" target="_blank">Merb 1.0.7 got released</a> yesterday with a bunch of bug fixes.</li>
<li>merb_sequel 1.0 should be released sometime this week and i&#8217;m planning on adding rails i18n syntax support to merb_babel.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2008/12/29/latest-merb-and-rails-30-news/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Merb/Rails merge, or Why should merbists be happy?</title>
		<link>http://merbist.com/2008/12/25/merb-rails-merge-or-why-should-merbists-be-happy/</link>
		<comments>http://merbist.com/2008/12/25/merb-rails-merge-or-why-should-merbists-be-happy/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 04:11:02 +0000</pubDate>
		<dc:creator>Matt Aimonetti</dc:creator>
				<category><![CDATA[merb]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[rails 3.0]]></category>

		<guid isPermaLink="false">http://merbist.com/?p=398</guid>
		<description><![CDATA[December 23, 2008, was an important day for the Ruby community. People who used to argue and not get along, have decided to sit down, talk and evaluate their differences. The end result is a strong collaboration of two teams who share the exact same goal. Overall, the news was very well received, just look [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/xrrr/2478140383/"><img class="alignright" title="merge" src="http://farm4.static.flickr.com/3211/2478140383_8e2e4ab7a3_m.jpg" alt="" width="240" height="160" /></a>December 23, 2008, was an important day for the Ruby community. People who used to argue and not get along, have decided to sit down, talk and evaluate their differences. The end result is a strong collaboration of two teams who share the exact same goal.</p>
<p>Overall, the news was very well received, just look at the tweets out there and the comments on <a href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge/" target="_blank">Yehuda&#8217;s</a> and <a href="http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3" target="_blank">Rails&#8217; blogs</a>.</p>
<p>Interestingly enough, the Rails community really embraced this decision and just got totally excited about the perspective of merging merb&#8217;s philosophy and expertise into Rails. If you re-read David&#8217;s blog post you can see that it&#8217;s a <strong>real homage to Merb</strong>.</p>
<p>The rest of the internet sounds pretty happy about the news, here are few posts:</p>
<ul>
<li><a href="http://arstechnica.com/news.ars/post/20081224-ruby-on-rails-and-merb-to-merge-for-rails-3.html" target="_blank">arstechnica.com</a></li>
<li><a href="http://www.internetnews.com/dev-news/article.php/3793296/Merb+Merges+With+Rails.htm" target="_blank">internetnews</a></li>
</ul>
<p>Even <a href="http://www.zedshaw.com" target="_blank">Zed the entertainer</a> thought it was a good thing:</p>
<blockquote><p><a href="http://www.zedshaw.com/blog/index.html" target="_blank">&#8220;I honestly didnâ€™t think that would ever happen. I just assumed that Merb<br />
would eventually wipe out Rails by being the better framework, or theyâ€™d<br />
wipe each other out soon.</a></p>
<p><a href="http://www.zedshaw.com/blog/index.html" target="_blank">So, congrats are in order. You guys are finally grown-ups and now have<br />
the chance to make something better.&#8221;</a></p></blockquote>
<p>Some <a href="http://iamruinous.com/2008/12/23/why-merb-becoming-rails-3-is-a-good-thing/" target="_blank">merbists like Jade Meskill</a> really understood what we are trying to do while some other ones got really <a href="http://www.mr-eel.com/archives/158" target="_blank">mad at us</a>.</p>
<p>I think a pattern emerged from the negative reactions:</p>
<ul>
<li>Why merge when we are about to win?!</li>
<li>What does Merb win by being merged into Rails?</li>
<li>Why not merge Rails into Merb?</li>
<li>You are killing innovation by killing the competition</li>
<li>You screwed us over and now I have to go &#8220;back&#8221; to Rails</li>
<li>Rails 3.0 won&#8217;t even be as good as Merb 1.x</li>
<li>The Rails team won&#8217;t let you do what you have to do to merge Merb into Rails</li>
<li>DHH is a jerk</li>
</ul>
<p>Let me quote Yehuda:Â  <strong>&#8220;Calm yourselves <img src='http://merbist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &#8221;</strong>.</p>
<h2>Why merge when we are about to win?!</h2>
<p>This is probably the most rational argument. This is also something the Merb core team considered for a little bit.<br />
Merb is gaining huge momentum and the target audience was very reactive to what we did.<br />
<a href="http://flickr.com/photos/mhaithaca/1317815300/"><img class="alignleft" title="super heroes" src="http://farm2.static.flickr.com/1087/1317815300_095983272e_m.jpg" alt="" width="240" height="160" /></a>People such as Yellow Pages, Wikipedia and even Adobe started using or looking seriously at Merb because of its focus on modularity and performance.<br />
We started building an elite community and we were pretty proud of that.</p>
<p>But take a moment to think about it. Our goal has never been to hurt or compete with Rails. Our goals were to get modularity, performance and a strong API. If the Rails team really wants that, and will work on it, why should we work against each other?<br />
It&#8217;s not about winning or losing. It&#8217;s all about the long term plan of your framework, about the people involved and the community behind it. We had to take ourselves out of the equation and consider what would be good for the Ruby community.</p>
<h2>What does Merb win by being merged into Rails?</h2>
<p>People seem to easily find things we might lose but have a hard time finding things we are gaining.<br />
<img class="alignright size-medium wp-image-404" title="rails" src="http://merbist.com/wp-content/uploads/2008/12/rails.png" alt="" width="87" height="112" />Looking at it on the very short term, this is probably correct. The merb team will have to learn how to work with the Rails team.<br />
We need to understand the reasons behind every single aspect of the code and find ways of merging things nicely.<br />
On top of that, we still need to work on merb as promised. (see Wycats&#8217; post)</p>
<p>However, in the long term we get all the benefits of Rails:<br />
- stability<br />
- community<br />
- traction<br />
- experience<br />
- don&#8217;t have to always justify why use Merb instead of Rails</p>
<p>But more importantly, we extend our team.</p>
<p>Most people using a framework might not realize what it is to work on a big Open Source project.<br />
When you work on an OSS project, people come and go, and that&#8217;s why you usually have a core team of people you can rely on.<br />
Merb has a lot of contributors but a small core team of 5 people (Yehuda, Carl, Daniel, Michael and myself).<br />
Managing a project, such as merb, requires a tremendous amount of time and patience. Rails has the same problem with its core team of 6 people. People have lives, business, projects etc&#8230;</p>
<p>Joining two teams of experts in developing web frameworks in Ruby is like if in the next Soccer World Cup, the French and Italian teams would go on the fields at the same time to beat other teams. 22 players on 1 side, training and learning together. American readers, please imagine the Giants and the Colts facing the Green Bay Packers (I was told I don&#8217;t like the Packers).</p>
<p>Long term, you will get better quality and more frequent releases. We also have different world views and backgrounds which means we will learn a lot from each other, again that means better code for you guys <img src='http://merbist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Why not merge Rails into Merb?</h2>
<p>That&#8217;s actually a good question. We discussed maybe using merb-core as a base for Rails 3.0<br />
The truth is that Merb 2.0 would probably be as big as Rails but more modular.<br />
So we have the choice to keep on building on top of Merb 2.0 or deconstruct Rails.<br />
As the Russians say: &#8216;Ð»Ð¾Ð¼Ð°Ñ‚ÑŒ â€” Ð½Ðµ ÑÑ‚Ñ€Ð¾Ð¸Ñ‚ÑŒ&#8217;, it&#8217;s always easier to take things apart <img src='http://merbist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img class="alignright" title="merge rails" src="http://farm4.static.flickr.com/3033/2814371262_04b9876490_m.jpg" alt="" width="180" height="240" />Rails already has a test suite, it has already been tested on the wild for a while and its internals are known to many developers. Taking apart the code to make it faster, cleaner and more modular is arguably easier than reinventing the wheel. At the end of the day it doesn&#8217;t really matter from which end you start as long as you end up with the same result.</p>
<p>Some people even asked to come up with a new name for the merged project. Meails, Mr Ails, Reverb, Reab were suggested. While I thought it was a joke, some people were really serious. Can you imagine if during the recent bailout, banks changed names every time they were purchased by another bank? People would be super confused and would not even know where to send their mortgage payments.<br />
On top of that, Rails has a huge user base compared to Merb and has an immense brand recognition in the world at large, it would be foolish to throw that away.</p>
<p>Let&#8217;s not be chauvinistic and see what&#8217;s best for all.</p>
<h2>You are killing innovation by killing the competition</h2>
<p>Again, a good point but my question to you is: Should we stay in the competition just for the sake of it?</p>
<p>Rails clearly told us: we want what you have and we would love you to work with us. So the options were:</p>
<ul>
<li>tell them to go to hell and let them try to redo what we already did and know how to do.</li>
<li> accept to work with them and make Rails a better framework.</li>
</ul>
<p><em>Option 1</em> would keep the competition alive, but now you have 2 groups of people trying to do the same thing and being better at different aspects. The community gets confused and communication breaks.</p>
<p><em>Option 2</em>: we lose the Merb vs Rails competition, but we double the amount of people working on Rails and therefore increase the change to make it better faster.</p>
<p>We went for option 2 and we know there is already some competition out there and there will be more coming up soon. I don&#8217;t think it&#8217;s realistic to expect us not to merge because we want to keep the competition going.</p>
<h2>You screwed us over and now I have to go &#8220;back&#8221; to Rails</h2>
<p>Yehuda will blog about some more detailed examples as we are making progress, but you need to stop thinking that Merb will just be absorbed into Rails.<br />
If Rails just wanted to add some &#8220;Merb flavor&#8221; to Rails, they would have just taken whatever they needed and would not be interested in a merge.<br />
See Rails 3.0 as a new generation of Rails, whatever we promised you for merb 2.0 plus all the goodies from Rails. Rails users will still have their default stack and all choices will be made for them (like in the current Merb stack). The difference for standard Rails user will be better performance, a static API and an option to go off the &#8220;golden path&#8221;.<br />
Merbists won&#8217;t lose the stuff they like in Merb, stacks, full support for DataMapper, Sequel and other ORMS, jQuery or other JS library, opt-in solution using just rails-core, better core isolation, built-in RSpec and webrat support, slices, merb-cache, merb-auth and all the other key plugins that will be ported over.</p>
<p>To be able to achieve all of that, we will have to make some infrastructure and code modifications.</p>
<p>Rails internals should end up:</p>
<p>* way less magical (even Merb uses some magic, but we&#8217;ll make sure to keep it to a minimum)<br />
* returning shorter and cleaner stack traces<br />
* cleaner (required for the new API)<br />
* better isolated (required to increase the modularity)<br />
* alias_method_chain won&#8217;t be available at the public API level (we probably still will need some chaining mechanism internally, but that&#8217;s a different story)</p>
<p>So, no, you don&#8217;t have to go &#8220;back&#8221; to Rails. In fact, imagine you could do exactly what Rails does but with the performance and modular architecture of Merb. That&#8217;s what you will get with Rails 3.0.</p>
<h2>Rails 3.0 won&#8217;t even be as good as Merb 1.x</h2>
<p>I think I mainly replied to this question in my previous answer.<br />
There is no reason why Rails 3.0 won&#8217;t be better than Merb 1.x.Â  Actually, I believe our API will actually be even better. With the help of David, the existing Rails core team, and the Rails community, we will be able to define an awesome API that will change the way ruby web development will be done.<br />
The merb API is great but we already know some of its limitations and we don&#8217;t have as many plugin developers to work with. Working with plugin developers is something I&#8217;m personally excited about. As a Rails developer I have been really frustrated when using 3rd party plugins and trying to develop my own.<br />
Having a well tested, developed against, public API will make all the Rails 3.0 plugins so much better. And because Merb plugins already use an API, we will be able to port all the plugins over, so it will be at least as good as 1.x<br />
Also, we are going to work on real app benchmark tests to make sure the performance gain is at least as good as what we have with Merb.</p>
<p>Migration will be easy and well documented. We are not giving up on the Merb book and it will be very useful to explain the Merb way to new comers wanting an idea of the new stuff in Rails 3.0. It will also be the best source of information to migrate your app to Rails 3.0.</p>
<p>Talking about migration, we promised to give you a sane migration path when it will be time to migrate.<br />
Again, don&#8217;t freak out because we are changing the name, the spirit of Merb will keep on living.</p>
<h2>The Rails team won&#8217;t let you do what you have to do to merge Merb into Rails</h2>
<p>In all honestly, I was worried about that. I was wondering if all of that was not an evil scam planned by DHH to kill Merb as it was getting a good momentum. I like conspiracy theories and it sounded pretty good.<br />
To my surprised, after a few private conversations with David, I realized that he was genuinely interested in making Rails better for people and fulfill the needs of people who need more flexibility.<br />
Just re-read his blog post <a href="http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3">http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3</a>. After what he said, how can he back up and just keep Rails the way it is? And why in the world would he want that to happen?<br />
It&#8217;s a team effort and we have already spent hours and hours discussing some details. I can promise you that the Rails team is very excited about the new stuff that&#8217;s coming up. But don&#8217;t forget that it&#8217;s a merge and we are reconsidering some of the stuff we did in Merb to better re-implement them in Rails 3.0.<br />
So far, I haven&#8217;t seen any of the Rails core team member tell us, no you can&#8217;t do that because that&#8217;s not the way it&#8217;s done in Rails or because we just don&#8217;t like it.</p>
<h2>DHH is a jerk</h2>
<p>Recently, in an interview I gave to rubylearning.com <a href="http://rubylearning.com/blog/2008/12/18/matt-aimonetti-why-on-earth-would-you-ignore-merb/">http://rubylearning.com/blog/2008/12/18/matt-aimonetti-why-on-earth-would-you-ignore-merb/</a> I mentioned that a big difference between Merb and Rails was the way we were dealing with the user base.<br />
I quoted David from an Interview he gave to InfoQ <a href="http://www.infoq.com/interviews/David-Hansson">http://www.infoq.com/interviews/David-Hansson</a> back in 2006.</p>
<p>As part of the merging evaluation process we literally spent hours talking back and forth. I had a seriously hard time believing that Rails and David honestly wanted to change their world views. How can you go from saying what you said in 2006 to adopting what Merb is pushing for: letting the framework bend to make what each developer wants if he doesn&#8217;t want to follow the &#8220;golden path&#8221;?</p>
<p>Interestingly enough, David recently addressed this point on his blog. <a href="http://www.loudthinking.com/posts/36-work-on-what-you-use-and-share-the-rest">http://www.loudthinking.com/posts/36-work-on-what-you-use-and-share-the-rest</a></p>
<p>&#8220;I wanted to take a few minutes to address some concerns of the last 4%. The people who feel like this might not be such a good idea. And in particular, the people who feel like it might not be such a good idea because of various things that I&#8217;ve said or done over the years.&#8221;</p>
<p>First thing first, David addresses the minority of people worried about his image and what it means for them.<br />
So, David actually cares about hard core merbists and he wants them to join the fun. I personally see this as something very encouraging!</p>
<p>A recurring theme we hear a lot is that Rails becomes whatever DHH/37signals needs/wants. If DHH needs something new, it will make it to Rails, if he doesn&#8217;t need it, it won&#8217;t.</p>
<p>David has a very simple and almost shocking response: DHH != Rails</p>
<p>David is really happy with Rails. Rails satisfies his needs but he knows that some people out there need/want something more/different.</p>
<p>&#8220;I personally use all of those default choices, so do many other Rails programmers. The vanilla ride is a great one and it&#8217;ll remain a great one. But that doesn&#8217;t mean it has to be the only one. There are lots of reasons why someone might want to use Data Mapper or Sequel instead of Active Record. I won&#8217;t think of them any less because they do. In fact, I believe Rails should have open arms to such alternatives.&#8221;</p>
<p>So, you can still think whatever you want about David. What&#8217;s important is that Rails is more than David. It&#8217;s an entire team of people with different needs and different views.</p>
<p>DHH isn&#8217;t a dictator and based on concrete examples such as the &#8220;respond_to vs provides&#8221; discussion, I can reassure you that David has been very receptive to arguments and never tried to force any decision because he thought it was better.</p>
]]></content:encoded>
			<wfw:commentRss>http://merbist.com/2008/12/25/merb-rails-merge-or-why-should-merbists-be-happy/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>

