Sunday, July 22, 2007

Rails running on Amazon's Elastic Compute Cloud

This is the way I am possibly pointing towards for hosting of my Ajax apps developed in the [not-too-distant] future. At the very least, going to research this a good amount: running a Rails Virtual Machine (or multiple clustered VM's) on Amazon's EC2.

I am currently using AS3 not only for backups, but for cross-domain resource loading (static images and JavaScript files). The value presented by AWS's EC2 is too much to ignore when thinking about the future. It's nice to see some Rails plugins already spring up related to this, (even though EC2 is in limited Beta currently, as far as I know) and no doubt it will continue. It's going to be a fun couple of years and beyond!

Deploy Rails app on EC2 via Capistrano
http://s3.amazonaws.com/rc_files/elastic_rails.mov
http://overstimulate.com/articles/2006/08/24/amazon-does-it-again.html
http://conferences.oreillynet.com/cs/rails2007/view/e_sess/14480
http://railspikes.com/2007/4/5/rails-on-ec2
http://elasticrails.com/elasticrails/

The elasticrails.com site explains that the new version of Capistrano (v2) broke functionality of his plugin, but it's a good reference to keep an eye on as this matures.

I am pointing/researching in this direction for my independent/ out-of-work apps and can only assume many others in industry and even companies might move this way as well, given the value it presents to independent devs, as well as even companies looking to host their app(s). Reason being is one can pretty readily set up redundancy (multiple VM's, clustered) for fault tolerance, and also, you only pay by the hour it's running, and last but not least, its infinitely scalable. [ Amazon's ECC approaches infinity, at least for practical purposes :) ]

So, for example, in the case of one site that runs 12 weeks per year, for hosting, I would effectively only pay for a maximum of 24 hours * 7 days/week * 12 weeks/year * $0.10 per instance hour = $201. per year (+ data transfer @ $0.10 per GB). Since the site doesn't transfer much data beyond static images, JavaScript files, generated html, this wouldn't be much more. Now I pay about $70 * 12 mos = $840 for hosting a variety of sites, which is about what one would pay if you ran Rails on EC2 (not including data) for a full year (~ $875). But, again, the scalable nature of EC2 is key.

2 comments:

Anonymous said...

For web hosting uses, I would strongly recommend an alternative elastic hosting solution to Amazon - there are several specialist web hosting products which offer a much fuller suite of accompanying web hosting services (domains, DNS, mail, etc.). These include:

UK: ElasticHosts
US: MediaTemple, Mosso

Mark Holton said...

Anonymous,
After about a year of research I actually settled on the Joyent Accelerator as part of they Joyent Cloud for my Ajax / Rails / potentially Merb apps! I really like EngineYard's infrastructure (and talent) also, but I don't yet have the app that would make that worth it.

I had some poor experiences with service at MediaTemple a few years back that has scared me off there.