
Today we evaluated Rails cloud hosting offerings from
Heroku and
Engine Yard. Each company claims you will have your app up and running in minutes. I thought I would take a moment to share our experiences with each vendor.
Here is the Heroku narrative. Signup was simple. Just confirm your email address and you are in. Free rails hosting without a bunch of BS. And it is a good service. You can't beat Heroku for that. Deployment is simple if you run a vanilla application, but you can run into all sorts of problems if you don't. Heroku applications run in a sandbox where your filesystem is readonly (except tmp). We ran into 2 problems. First, we are using bundler. Normally you gitignore your .bundler directory in your application, but because of the heroku readonly filesystem you have to commit your .bundler directory so when heroku runs bundle install there is a environment.rb file already in place. Another gotcha is that we use sass, which compiles to css. You have to check in the compiled css files for the same reason. There is a gem called
hassle (hilarious) that has been created to get around this problem. Finally, we got the app up and running on Heroku. I still give heroku high marks becuase of the free service and the possibility of a simple deployment.
My Heroku pro tip: If you plan to go Heroku, deploy the moment you create the skeleton rails application and make deployment a nightly step in your CI server. That way when you introduce some dependency that Heroku hates, you know immediately.
Now for the Engine Yard narriative. Signup is again pretty easy with EY, but you have to have a credit card to do anything because creating an app instance costs 11 cents an hour. Move along freeloaders. No free rides at Engine Yard! Deployment is very customizeable, yet simple. Give them the URL to yout git repo and click "deploy". EY pulls your app and does the rest. While using bundler at Heroku was major ass pain, with EY it is a big benefit becuase you don't have to manually specify the gems on your server. Simply install the bundler gem. Then create a file called deploy/before_migrate.rb in your application. In that file you can call "bundle install", and you are all done! The beauty of EY is that you can use a fancy web interface to do nearly everything, or you can drop down to SSH and hack around at the command line. So though it looks harder because there are more levers and knobs, in the end deployment at Engine Yard is easier than Heroku because the environment is alot like your development environment. There are no magic readonly filesystem or special remote rake tasks. If I want to see what's up with the app I can just tail a log file or run script/console. Overall high marks for EY's customizeability, and ease of deployment.
My EY pro tip: go look at "
chef" the deployment tool that EY uses on github. If your app has any custom tasks that you need to run before it starts up you can specify them there.
What about cost? Heroku offers a free service, which is a totally awesome resource for the Rails community. Hats off to Heroku for that. On the downside, with Heroku everything is an add on. 20$ a month to send emails, 100$ a month for SSL, 200$ a month for a dedicated DB. That adds up! EY's cheapest option runs about 70$ a month. A dedicated DB system costs 170$ a month, but there aren't lots of add on hidden costs. The big kicker is that with Heroku you pay lots of money to run a single application. With EY you pay lots of money and get a server which means you can run as many applications on that one server as you like. I think you get more bang per buck with EY.
I know. Blah blah blah, what is the verdict? Well, sorry to dissappoint, but as usual, it depends. If you want it to be free Heroku is the only game in town. If your application is very, very simple or doesn't have any of these
constraints, Heroku is probably the way to go. But, if you are willing to pay for it you get more bang for your buck with EY.
Both companies have great offerings. I'd say use both of them. The great thing about being in the cloud is that you are paying on a hourly or per cpu cycle basis. Just turn the server on when you need it. If you aren't using it, you don't pay.