I have been following the buzz of Ruby on Rails (RoR) for quite a while, and recently had been getting my hands on a few tutorial and instant fallen in love with it. RoR is perceived to have high productivity gain, with an almost complete suite of web framework (Rails) and backing of a powerful and clean new age language (Ruby). It gave me quite a good impression, though I had not developed anything serious with it (neither had I master it), but I am planning my next project on it.
One major drawback of RoR is deployment. First of all, there aren’t many web hosting company out there support RoR, thus it won’t be as cheap or as common as PHP. Luckily my web hosting company is quite innovative and supported RoR few months back, thus it kinda motivate me to give it a spin.
I have no idea how to deploy a RoR application, thus I copy my entire application folder to the server and that didn’t work. Luckily the web hosting guys is quite helpful and gave me a shell account (more power, muahahaha).
- Login into my shell account, and go to my web folder
- run “rails app_name”, using the same name as my application
- Configure database in config/database.yml
- Replace the entire app folder
- Go to http://server/app_name/public and a Ruby page is shown (since my application is not properly configured yet)
- To test whether RoR is working or not, just go to one of the controller and test it out, such as http://server/app_name/public/recipe/list
Upon further research, I found RoR is actually quite messy in terms of deployment and hosting. In order to have reasonable performance, they have
- FastCGI - language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs
- SCGI - a project to replace CGI and FastCGI with a simpler protocol to both implement and manage
- Lighttpd - a fast web server that is very similar in speed to Apache 2.0 MPM-Worker on Linux
- Mongrel - a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI
At this moment, RoR deployment and hosting is not straightforward and neither well supported. RoR could be fast in development, but it might have drawbacks in performance and deployment/hosting.
As such is the life of bleeding-edge technology, there are bound to be lots of technical obstacles and non-standardization. Competition is good, but there is lots of casualty during the war. I still remember when I get my hands on PHP 5.0.0 and start coding on it, and yet couldn't find any cheap web hosting company which supports it. Thus I revert everything back to PHP4 which is well supported and supposing run faster.
There is a price to pay for bleeding-edge technology, go there only if you are well prepared.
---
Forgive me for my slight ignorance and lack of knowledge. It seems like Lighttpd and Mongrel can work together with Apache through its mod_proxy_balancer module. So, it depends how well your web hosting company configured RoR for you, or how difficult is it for you to configure the optimum setup for your box. Anyway, there seems to be a growing trend to ditch Apache and use Lighttpd instead, which might be bad news for market stability
Anything which worries me is RoR performance, it may be fast to develop, but it may not run fast. RoR with Apache + CGI is definitely is no no, as it crawls and abviously slow. I am not quite sure about Apache + FastCGI, it should be slightly better, but there seems to be better (and more complicated) options out there.
Framework Performance for Symfony on PHP, Rails on Ruby and Django on Python should be quite a good read.
No comments:
Post a Comment