<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Ruby on Rails and the importance of being stupid</title>
	<atom:link href="http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/</link>
	<description>A posting every day; an interesting idea every three months...</description>
	<lastBuildDate>Tue, 01 Dec 2009 17:59:54 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: philg</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-138907</link>
		<dc:creator>philg</dc:creator>
		<pubDate>Thu, 22 Oct 2009 14:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-138907</guid>
		<description>Nathan: The programmer never thanked me for pointing out that his world of slices did not have sufficient RAM, so maybe I should identify the ungrateful non-planner/non-documenter. However, I fear that his sins are all too common. He may not be Everyprogrammer, but his style of work certainly has plenty of company in the Web development world. Plus, how can I hate the guy who inspired http://philip.greenspun.com/software/design-review ?</description>
		<content:encoded><![CDATA[<p>Nathan: The programmer never thanked me for pointing out that his world of slices did not have sufficient RAM, so maybe I should identify the ungrateful non-planner/non-documenter. However, I fear that his sins are all too common. He may not be Everyprogrammer, but his style of work certainly has plenty of company in the Web development world. Plus, how can I hate the guy who inspired <a href="http://philip.greenspun.com/software/design-review" rel="nofollow">http://philip.greenspun.com/software/design-review</a> ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-138900</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Thu, 22 Oct 2009 13:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-138900</guid>
		<description>hi Philip,
You&#039;re careful not to identify the credentialed programmer who perpetrated the mess, I&#039;m curious about the ethics of that. At what point do you identify him and open him up to his richly-deserved public humiliation? People like the guy you describe give us all a bad name.</description>
		<content:encoded><![CDATA[<p>hi Philip,<br />
You&#8217;re careful not to identify the credentialed programmer who perpetrated the mess, I&#8217;m curious about the ethics of that. At what point do you identify him and open him up to his richly-deserved public humiliation? People like the guy you describe give us all a bad name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Thornton</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-135039</link>
		<dc:creator>James Thornton</dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-135039</guid>
		<description>Hi Phil -

It looks like one of your former SEIA students, Dan Chak, just published a book on scaling Rails. 

It&#039;s called &quot;Enterprise Rails,&quot; and Hal Abelson reviewed it, saying, &quot;Enterprise Rails is indispensable for anyone planning to build enterprise web services. It&#039;s one thing to get your service off the ground with a framework like Rails, but quite another to construct a system that will hold up at enterprise scale. The secret is to make good architectural choices from the beginning. Chak shows you how to make those choices. Ignore his advice at your peril.&quot;

http://www.amazon.com/Enterprise-Rails-Dan-Chak/dp/0596515200/

Chak comes from an ACS/AOLserver background and worked at Amazon, and I started using ACS/AOLserver back in the nineties so I was intrigued by his view on Rails.

All the best.

James</description>
		<content:encoded><![CDATA[<p>Hi Phil -</p>
<p>It looks like one of your former SEIA students, Dan Chak, just published a book on scaling Rails. </p>
<p>It&#8217;s called &#8220;Enterprise Rails,&#8221; and Hal Abelson reviewed it, saying, &#8220;Enterprise Rails is indispensable for anyone planning to build enterprise web services. It&#8217;s one thing to get your service off the ground with a framework like Rails, but quite another to construct a system that will hold up at enterprise scale. The secret is to make good architectural choices from the beginning. Chak shows you how to make those choices. Ignore his advice at your peril.&#8221;</p>
<p><a href="http://www.amazon.com/Enterprise-Rails-Dan-Chak/dp/0596515200/" rel="nofollow">http://www.amazon.com/Enterprise-Rails-Dan-Chak/dp/0596515200/</a></p>
<p>Chak comes from an ACS/AOLserver background and worked at Amazon, and I started using ACS/AOLserver back in the nineties so I was intrigued by his view on Rails.</p>
<p>All the best.</p>
<p>James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne M</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-124313</link>
		<dc:creator>Wayne M</dc:creator>
		<pubDate>Mon, 01 Jun 2009 02:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-124313</guid>
		<description>Very nice article.  While I really like Rails, I utterly hate the &quot;magic&quot; because it provides too much abstraction away from what&#039;s happening.  If you ask me, Rails and Domain Specific Languages are both &quot;leaky abstractions&quot; and not in the good way - Ruby and Rails especially hide all the complex stuff behind a facade to make it look like English and use this as a selling point (&quot;The code reads like prose!&quot;) when in fact it&#039;s one of the absolute worst things that can be done, because you get a lot of &quot;cargo cult&quot; programmers who follow along without ever really understanding what belongs_to or has_many is doing under the hood.</description>
		<content:encoded><![CDATA[<p>Very nice article.  While I really like Rails, I utterly hate the &#8220;magic&#8221; because it provides too much abstraction away from what&#8217;s happening.  If you ask me, Rails and Domain Specific Languages are both &#8220;leaky abstractions&#8221; and not in the good way &#8211; Ruby and Rails especially hide all the complex stuff behind a facade to make it look like English and use this as a selling point (&#8221;The code reads like prose!&#8221;) when in fact it&#8217;s one of the absolute worst things that can be done, because you get a lot of &#8220;cargo cult&#8221; programmers who follow along without ever really understanding what belongs_to or has_many is doing under the hood.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François Schiettecatte</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-123866</link>
		<dc:creator>François Schiettecatte</dc:creator>
		<pubDate>Fri, 29 May 2009 13:20:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-123866</guid>
		<description>This is a very interesting discussion and I wanted to add my $0.02&#039;s worth.

First off I believe in giving MySQL all the memory I can, the more memory the happier it will be, period. Memory is so cheap these days, not doing so makes no sense. It is preferable to limit the dataset size to fit in memory but that is not always possible, but at least make sure you can fit the indices in memory. Also it is best to allocate the memory to MySQL as opposed to the file cache for Linux. Bear in mind that there is overhead to MySQL, so for InnoDB a good rule of thumb is 3x overhead.

Also there is some patterns to avoid when you are trying to get the best performance out of MySQL such as avoiding joins, large selects, table scans, and unindexed selects, updates and deletes. Nothing out of the ordinary really.

I am usually against using Memcached for a few reasons. Why allocate memory to Memcached when you can allocate it to your DBMS. Using Memcached adds another level of management to the application which adds to the complexity (aging data, etc...) Memcached is usually trotted out to work around performance problems rather than fixing them because it is a quicker solution. Finally Memcached stores blobs of data which need to be serialized and deserialized. That being said, I would use Memcached where it makes sense.

I was not aware that Linux limited the amount of space allocated to caching files, I think that may have changed, my understanding is that current releases are very aggressive with caching, but I could be wrong.

Running Linux with no swap is fine, I know of some MySQL admin who do it. The only thing to be aware of is that Linux will kill off the largest user process if it runs out of memory, which on a machine running MySQL is usually MySQL.

One trick I have used in the past it to allocate as much shared memory as there is RAM in a machine and to copy files from the file system to the /dev/shm file system which linux tries to keep in RAM as much as possible. I wrote a post about this a while back: http://fschiettecatte.wordpress.com/2007/05/27/sharing-the-memories/</description>
		<content:encoded><![CDATA[<p>This is a very interesting discussion and I wanted to add my $0.02&#8217;s worth.</p>
<p>First off I believe in giving MySQL all the memory I can, the more memory the happier it will be, period. Memory is so cheap these days, not doing so makes no sense. It is preferable to limit the dataset size to fit in memory but that is not always possible, but at least make sure you can fit the indices in memory. Also it is best to allocate the memory to MySQL as opposed to the file cache for Linux. Bear in mind that there is overhead to MySQL, so for InnoDB a good rule of thumb is 3x overhead.</p>
<p>Also there is some patterns to avoid when you are trying to get the best performance out of MySQL such as avoiding joins, large selects, table scans, and unindexed selects, updates and deletes. Nothing out of the ordinary really.</p>
<p>I am usually against using Memcached for a few reasons. Why allocate memory to Memcached when you can allocate it to your DBMS. Using Memcached adds another level of management to the application which adds to the complexity (aging data, etc&#8230;) Memcached is usually trotted out to work around performance problems rather than fixing them because it is a quicker solution. Finally Memcached stores blobs of data which need to be serialized and deserialized. That being said, I would use Memcached where it makes sense.</p>
<p>I was not aware that Linux limited the amount of space allocated to caching files, I think that may have changed, my understanding is that current releases are very aggressive with caching, but I could be wrong.</p>
<p>Running Linux with no swap is fine, I know of some MySQL admin who do it. The only thing to be aware of is that Linux will kill off the largest user process if it runs out of memory, which on a machine running MySQL is usually MySQL.</p>
<p>One trick I have used in the past it to allocate as much shared memory as there is RAM in a machine and to copy files from the file system to the /dev/shm file system which linux tries to keep in RAM as much as possible. I wrote a post about this a while back: <a href="http://fschiettecatte.wordpress.com/2007/05/27/sharing-the-memories/" rel="nofollow">http://fschiettecatte.wordpress.com/2007/05/27/sharing-the-memories/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fazal Majid</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-123053</link>
		<dc:creator>Fazal Majid</dc:creator>
		<pubDate>Fri, 22 May 2009 14:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-123053</guid>
		<description>There is nothing wrong with Ruby (the language) or MySQL, but in my experience database abstraction layers like those bundled with Rails always bite you. If you must use one, get one that allows you to override with hand-tuned SQL when you need to.

As for RAM utilization, your data set may fit in 2.5GB today, and make an application that makes full table scans (due to poor coding or lack of indexes) look like it is performing acceptably. But once the data size hits 2.500001GB, performance is going to collapse. It would be worth doing some profiling to find out which pages cause the most problems. Obviously, if the site is failing and time is critical, upgrading RAM is a sensible band-aid, but you can&#039;t stop there.

Regarding the Linux buffer cache problems, Linux&#039;s VM subsystem has been unnecessarily rewritten so many times between 2.4 and 2.6 it&#039;s not surprising even experienced sys admins could not figure it out. Solution: use a non-toy OS like Solaris or FreeBSD.

Finally, regarding Microsoft solutions - I have plenty of experience with Fortune 500 corporations who have Windows web hosting farms where IIS can&#039;t even handle static file serving without clogging up with memory leaks, and our best Windows experts have absolutely no tools to figure out what the hell is going on. Solution: use the F5 load-balancers in front of the Windows farm to offload the said file serving to Apache running on Solaris machines with half the hardware resources. ASP.NET is fairly efficient, far more so than Java, but it is subject to sudden degradation in performance and once that happens you are in a hole it is very difficult to dig out of.</description>
		<content:encoded><![CDATA[<p>There is nothing wrong with Ruby (the language) or MySQL, but in my experience database abstraction layers like those bundled with Rails always bite you. If you must use one, get one that allows you to override with hand-tuned SQL when you need to.</p>
<p>As for RAM utilization, your data set may fit in 2.5GB today, and make an application that makes full table scans (due to poor coding or lack of indexes) look like it is performing acceptably. But once the data size hits 2.500001GB, performance is going to collapse. It would be worth doing some profiling to find out which pages cause the most problems. Obviously, if the site is failing and time is critical, upgrading RAM is a sensible band-aid, but you can&#8217;t stop there.</p>
<p>Regarding the Linux buffer cache problems, Linux&#8217;s VM subsystem has been unnecessarily rewritten so many times between 2.4 and 2.6 it&#8217;s not surprising even experienced sys admins could not figure it out. Solution: use a non-toy OS like Solaris or FreeBSD.</p>
<p>Finally, regarding Microsoft solutions &#8211; I have plenty of experience with Fortune 500 corporations who have Windows web hosting farms where IIS can&#8217;t even handle static file serving without clogging up with memory leaks, and our best Windows experts have absolutely no tools to figure out what the hell is going on. Solution: use the F5 load-balancers in front of the Windows farm to offload the said file serving to Apache running on Solaris machines with half the hardware resources.&nbsp;<a href="http://ASP.NET" title="http://ASP. " target="_blank">ASP.NET</a> is fairly efficient, far more so than Java, but it is subject to sudden degradation in performance and once that happens you are in a hole it is very difficult to dig out of.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen van Egmond</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-122890</link>
		<dc:creator>Stephen van Egmond</dc:creator>
		<pubDate>Thu, 21 May 2009 17:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-122890</guid>
		<description>Philip-

I personally appreciate your caveman approaches. Your writings over the years about embracing simplicity in software and system design have been valuable.

It is extremely important to know what is going on under the hood of anything you do in code; the MIT Genius seems to have forgotten that.  The virtues of the caveman approaches are that you know exactly what&#039;s going: this query is being run, and over here I loop over the rows, fetch it into RAM, or whatever.  

The danger, in my view, is that modern languages have first paved over memory-management concerns (garbage collection) and now database overhead (ORMs). Lo and behold, we now have a new swath of powerful tools, all ready to shoot ourselves in the foot.  Your ASP users were fortunate that they had no such tools at their disposal.

The lesson seems to have been forgotten: adding abstractions to a system generally makes it harder to understand and fix performance problems, and often makes them easier to create. The defensiveness of the rails developers on this point is bizarre.</description>
		<content:encoded><![CDATA[<p>Philip-</p>
<p>I personally appreciate your caveman approaches. Your writings over the years about embracing simplicity in software and system design have been valuable.</p>
<p>It is extremely important to know what is going on under the hood of anything you do in code; the MIT Genius seems to have forgotten that.  The virtues of the caveman approaches are that you know exactly what&#8217;s going: this query is being run, and over here I loop over the rows, fetch it into RAM, or whatever.  </p>
<p>The danger, in my view, is that modern languages have first paved over memory-management concerns (garbage collection) and now database overhead (ORMs). Lo and behold, we now have a new swath of powerful tools, all ready to shoot ourselves in the foot.  Your ASP users were fortunate that they had no such tools at their disposal.</p>
<p>The lesson seems to have been forgotten: adding abstractions to a system generally makes it harder to understand and fix performance problems, and often makes them easier to create. The defensiveness of the rails developers on this point is bizarre.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Attikus Robinson</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-122668</link>
		<dc:creator>Attikus Robinson</dc:creator>
		<pubDate>Wed, 20 May 2009 15:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-122668</guid>
		<description>Hi Philip,

Great post.  Some observations:

1) Programmers think modern &quot;abstractions&quot; protect them from having to worry about stuff like SQL, hardware, etc.  Joel Spolsky of JoelonSoftware.com covered this very well in &quot;Law of Leaky Abstractions&quot; (http://www.joelonsoftware.com/articles/LeakyAbstractions.html)

2)  At most large shops the &quot;database guy&quot; and &quot;developers&quot; are two different classes of citizen.  &quot;Developers&quot; are &quot;real programmers&quot; whereas database guys...or database guys.  The two don&#039;t overlap.  &quot;Real programmers&quot; don&#039;t worry themselves with the database.</description>
		<content:encoded><![CDATA[<p>Hi Philip,</p>
<p>Great post.  Some observations:</p>
<p>1) Programmers think modern &#8220;abstractions&#8221; protect them from having to worry about stuff like SQL, hardware, etc.  Joel Spolsky of&nbsp;<a href="http://JoelonSoftware.com" title="http://JoelonSoftware. " target="_blank">JoelonSoftware.com</a> covered this very well in &#8220;Law of Leaky Abstractions&#8221; (<a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html" rel="nofollow">http://www.joelonsoftware.com/articles/LeakyAbstractions.html</a>)</p>
<p>2)  At most large shops the &#8220;database guy&#8221; and &#8220;developers&#8221; are two different classes of citizen.  &#8220;Developers&#8221; are &#8220;real programmers&#8221; whereas database guys&#8230;or database guys.  The two don&#8217;t overlap.  &#8220;Real programmers&#8221; don&#8217;t worry themselves with the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: johan</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-122653</link>
		<dc:creator>johan</dc:creator>
		<pubDate>Wed, 20 May 2009 13:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-122653</guid>
		<description>Philip,

One of the alternatives to ActiveRecord is Datamapper (mostly associated with Merb).

You&#039;ll find more details here:

   http://datamapper.org/doku.php?id=why_datamapper

With Rails 3.0 coming up,  DataMapper may well get some more attention.


rgrds,

Johan</description>
		<content:encoded><![CDATA[<p>Philip,</p>
<p>One of the alternatives to ActiveRecord is Datamapper (mostly associated with Merb).</p>
<p>You&#8217;ll find more details here:</p>
<p>   <a href="http://datamapper.org/doku.php?id=why_datamapper" rel="nofollow">http://datamapper.org/doku.php?id=why_datamapper</a></p>
<p>With Rails 3.0 coming up,  DataMapper may well get some more attention.</p>
<p>rgrds,</p>
<p>Johan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://blogs.law.harvard.edu/philg/2009/05/18/ruby-on-rails-and-the-importance-of-being-stupid/comment-page-1/#comment-122627</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Wed, 20 May 2009 07:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.law.harvard.edu/philg/?p=1317#comment-122627</guid>
		<description>Thanks for the thought-provoking article, philg. I love it.

I&#039;m a big fan of Ruby on Rails and I&#039;m really surprised by the negative reactions from the community. It seems to me your article aligns very well with the philosophy of RoR: keep it simple.</description>
		<content:encoded><![CDATA[<p>Thanks for the thought-provoking article, philg. I love it.</p>
<p>I&#8217;m a big fan of Ruby on Rails and I&#8217;m really surprised by the negative reactions from the community. It seems to me your article aligns very well with the philosophy of RoR: keep it simple.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
