[dundee] Rails work

Gary Short gary at garyshort.org
Mon Feb 11 13:43:38 GMT 2008


-------- Original Message --------
> From: Lee Hughes <toxicnaan at yahoo.co.uk>
> Sent: 11 February 2008 13:28
> To: Tayside Linux User Group <dundee at mailman.lug.org.uk>
> Subject: Re: [dundee] Rails work
> 
> Can't you just load balance with a farm? I've load balanced a few php apps
> before, with success? or is there something with rails I'm missing?
> does it support database locking for example?

The trouble with Rails is that it uses the MVC pattern (Model, View Controller) where the interaction between the Model (an object that holds entity information and has business behavour) and the View (the web page in this case) is managed by the Controller.

So, you may see a URL like http://www.MyDomain.com/customer/12/edit (which means edit the customer who has id = 12). However, this URL doesn't actually exist and Mod_rewrite is used to route the request to http://www.MyDomain.com/controllers/customer.rb (or similar) passing /customer/12/edit as a parameter so that the code in the controller knows what to do. This is really cool BTW, but makes load balancing a PITA.

This is not a problem confined to Rails of course, all MVC frameworks (Rails, ASP.Net MVC, CakePHP etc) have this problem to overcome. However, Rails further suffers from Ruby's inherent poor performance aswell. Look out for this being fixed in the short to medium term though, very clever people are working on it right now.

-- 
Cheers,
Gary
http://www.garyshort.org







More information about the dundee mailing list