Recently there have been a slew of posts complaining that rails doesn't scale and is hard to deploy. I think the root of this is that people come to rails after experience with Java, PHP or similar frameworks. Rails is neither of these. It is heavier than PHP, and it seems that this makes its fit with the typical PHP deployment methods slow at best. At the same time it has an entirely different deployment model than Java web applications. The Java application containers are heavier, and designed to support a much more highly available application within that JVM instance.
But rails still has its sweet spot. So why would I use rails instead of Java? It's not as light as PHP, but from a development perspective it's usually close enough. Bouncing webrick or mongrel takes a second or two, and for most changes I don't even need to do this. To accomplish the same code/test cycle in Java takes at least 10 times as long, often much worse. At the same time rails offers. Plus I can do a lot of things I can't do with Java, thanks to dynamic typing, better metaprogramming facilities, and things like the rails console. Plus, from a hosting perspective you can get much better deals on hosting a rails application than a full Java servlet environment, which tells you something about the relative difficulty of hosting rails and J2EE.
Why would I use it instead of PHP? The framework does enough magic that getting an application up and running is faster than raw PHP (disclaimer: I haven't used any of the newer PHP frameworks like CakePHP . Maybe they're more on par with rails here.). MVC is nicely broken out. Ruby itself is a wonderful language to develop in. Yes, you're going to have to do more work around deployment. I can't imagine going live using FastCGI, SCGI, or that sort of thing. But learn how to set up a mongrel cluster. That seems to work.
I think Java and PHP still have their places as well. Java provides much better concurrency in a single process, better built-in capabilities for high availability, security, and a larger library/tool ecosystem. Enterprises know how to deploy and maintain Java applications, and in general feel more comfortable putting those in production than a rails system. PHP is lighter weight, will likely scale better out of the box, and is better understood by most hosting companies.
At the end of the day the decision comes down to what you're building and where you're deploying. I think rails works in wide range of situations, but there is an equally wide range where PHP or Java may be a better choice.
But rails still has its sweet spot. So why would I use rails instead of Java? It's not as light as PHP, but from a development perspective it's usually close enough. Bouncing webrick or mongrel takes a second or two, and for most changes I don't even need to do this. To accomplish the same code/test cycle in Java takes at least 10 times as long, often much worse. At the same time rails offers. Plus I can do a lot of things I can't do with Java, thanks to dynamic typing, better metaprogramming facilities, and things like the rails console. Plus, from a hosting perspective you can get much better deals on hosting a rails application than a full Java servlet environment, which tells you something about the relative difficulty of hosting rails and J2EE.
Why would I use it instead of PHP? The framework does enough magic that getting an application up and running is faster than raw PHP (disclaimer: I haven't used any of the newer PHP frameworks like CakePHP . Maybe they're more on par with rails here.). MVC is nicely broken out. Ruby itself is a wonderful language to develop in. Yes, you're going to have to do more work around deployment. I can't imagine going live using FastCGI, SCGI, or that sort of thing. But learn how to set up a mongrel cluster. That seems to work.
I think Java and PHP still have their places as well. Java provides much better concurrency in a single process, better built-in capabilities for high availability, security, and a larger library/tool ecosystem. Enterprises know how to deploy and maintain Java applications, and in general feel more comfortable putting those in production than a rails system. PHP is lighter weight, will likely scale better out of the box, and is better understood by most hosting companies.
At the end of the day the decision comes down to what you're building and where you're deploying. I think rails works in wide range of situations, but there is an equally wide range where PHP or Java may be a better choice.
