Rails Developers – Environment Discussion
Rails Developers always want to do things in style. Its always been a classical question, what is good for Ruby on Rails developers: AWS or Heroku. The same discussion is been happening in our company, among Rails Developers for a while and I could say that this is a never-ending debate. But working with different Ruby on Rails developers from different background and experience, I could see some pattern of points being exchanged in discussions. Am trying to consolidate those common points in this blog post.
First lets understand the fact that comparing AWS and Heroku is not an apple-to-apple comparison. AWS is IaaS (Infrastructure as a Service) and Heroku is PaaS (Platform as a Service). What is the difference? IaaS offers a set of components a developer need in order to build an application on top of it. PaaS gives a ready to deploy environment, where the developer has to move the code along with minimal configuration changes to make the application works. IaaS needs more skill to deploy, but PaaS empowers the developer to concentrate more only on code.
AWS actually have a PaaS offering: “Elastic Beanstalk”, that supports Ruby, Node.js, PHP, Python, .NET and Java, but most of the crowd jumps otherwise so keeping AWS PaaS out of discussion/comparison for now.
Environment Components – Rails Developer View:
From the Ruby on Rails developer’s point of view they mostly use the following componenets.
AWS is about EC2 instances, S3, Load Balancer, Cache Layer, Apache, Passenger, Ruby, Rails, PostgreSql…what not, whatever a Ruby on Rails developer needs for development/deployment, to be individually configured. Finally Ruby on Rails developer has to implement deployment system like Capistrano and more on about Logging system too.
Heroku, well it’s not about setting up individual components. Rails Developers has to make few lines of code change in the application, make necessary add-ons, do a git-push; that’s it.
Security Horizon – Rails Developer View:
In AWS mostly the security updates and the patching is about doing it manually by Rails Developers when and where its required. There is a good chance that this activity is poorly managed and the production servers being well behind the security updates. With Heroku, Security updates are owned by the platform but not the Rails Developers. There are mixed opinions about Heroku owning the responsibility and there are instances where the activity goes against the deployed code, but for sure this takes away lot of head-aches from Rails Developers.
Scaling Application – Rails Developer View:
I have explained on how generally a Ruby on Rails developer implements the environment in their IaaS vs PaaS comparison above. Approximately, the application has a Procfile, which has lines of the form dyno_type: command_to_run, so for example (refer from http://devcenter.heroku.com/articles/process-model):
web: bundle exec rails server worker: bundle exec rake jobs:work
This, with a:
heroku scale web:4 worker:15
will result in you having 4 web dynos and 15 worker dynos running. Note that web is a special dyno type, which has access to the outside world, and is behind their nice web traffic multiplexer that will route traffic accordingly.
Again it’s not right to compare the AWS and Heroku on the cost factor. Even though the cost of using Heroku environment be 100% costlier that AWS, the amount of time & effort involved matters more on EC2 to Dyno. It is probably not too unreasonable to consider a dyno as a bit like an EC2 micro instance. But the amount of time and effort required for the Ruby on Rails developer to build an environment on top of an IaaS offering to get it to PaaS standard is definitely not cheap and easy. Let us also agree cost associated with the manpower required for setting up an environment and maintaining it.
Both Heroku and AWS are excellent platforms. Ruby on Rails developers wants to concentrate more on the “Code” now than that of the environment, so most of them prefers to work on Heroku for development, testing, staging and production for the application to start with. But for very “Serious Production Deployment” with several paying customers with complex application setup, with a SLA to maintain, with dedicated time to spend on Dev-Ops etc can’t quite bring Rails Developers to offload that much control to Heroku, and then AWS would be the choice. The winning platform may be AWS or Heroku, whichever one most helps Rails developers to achieve the goals, keeps them happy and productive; while remaining affordable enough to be sustainable. Rails Developers – Happy Coding !!!!