There’s been a bit of discussion lately on deployment options. Much of the debate is centered around the relative merits of Heroku. We have some experience with Heroku and Amazon Web Services (AWS), so let’s dive into some comparisions.
This is the only metric that counts for many clients, so it’s good to start here. The trouble with price comparisons is that no two services are exactly the same, so it’s hard to do an apples-to-apples comparison. So let’s see what we can get at the entry level.
You can’t beat free, and this is actually quite a good offering. One dyno is plenty to run many kinds of apps. Brochure sites, simple APIs, and blogs are a few of the many possible uses for this free dyno. But to make the comparison fair, we need to know what this free dyno includes and what strings are attached.
Amazon Elastic Compute Cloud (Amazon EC2) is the closest equivalent to Heroku’s dynos. One EC2 micro instance is approximately equivalent in terms of RAM and compute power to one of Heroku’s dynos/workers. However, in our experience, the performance of a full-stack Rails application on a single micro EC2 instance is not quite as good as on a single Heroku dyno. This could be because we were running database and workers on the same instance. We could have probably slimmed down the instance by removing unnecessary system processes, but instead we typically go with a small EC2 instance.
As you can see, EC2 is much cheaper when paid for in advance. Let’s just go with a one year heavy utilization reserved small instance for this comparison.
Again, it’s hard to make a direct comparison, but some of these figures are considerably higher than Heroku’s (1600 times the storage space!).
Say we have an app that needs 10MB database storage, one worker, and SSL. With Heroku this will break down to the following:
To get the same thing on Amazon you’d pay the following:
Admittedly it’s not a huge savings for the first month, but let’s say you need to add Redis and MongoDB. They both live mainly in memory, so it’s a good thing we went with the 1.7GB RAM on Amazon. We can easily run both of these services on our single small instance. On Heroku we’d need to add the following:
With Amazon it’s easy from a price perspective to add or remove services. If you go with Heroku, you may have to ask your client for an additional monthly payment for each service you add, making the decision more difficult and time consuming.
Besides costs, you will want to consider whether or not it’s even possible to run your application on Heroku before going that route. If you need to run custom binaries or compile from source, you will have to figure out how to hack Heroku, or you may be out of luck. If you need to store temporary files you should know that
Heroku’s ephemeral file system does not make that task easy. You could end up exerting a lot of effort only to eventually run into a brick wall. Personally, I’ve had to hack gems and try to find workarounds for many Heroku-specific issues.
On the other hand, if you know your application will fit within the limitations, deployment on Heroku is a breeze. The web interface is beautiful, the CLI client works well for the most part (except it can’t manage multiple Heroku accounts), and it’s easy to add other services through add-ons. But if you think your app’s needs might grow in ways that won’t be satisfied by simple horizontal scaling, you should definitely consider AWS. Of course, you can always start with Heroku and later migrate to AWS, but in that case you will have to configure your app for two environments and spend the time to migrate everything.
In my experience, there are simply no other platforms that compare well with Heroku or AWS. There are some nice Heroku alternatives such as Dotcloud, but they suffer from coming after Heroku and thus having less integration with third-party products and less community support. Rackspace is the closest competitor to AWS, but it lacks the rich APIs and support that Amazon provides. Hopefully, we’ll see competitors catching up to Heroku and AWS and offering us more choices.
Both Heroku and AWS are excellent platforms. They are quite different in some key areas. Understanding what each offers is essential to picking the right platform for your application. There is no clear winner here. Personally I like to use both. But my (simplified) mental test for which one to use is this: small app–Heroku; large app–Amazon. The winning platform is whichever one most helps you achieve your goals through keeping your developers happy and productive while remaining affordable enough to be sustainable.
Editors note: Reed recently revisited the Heroku vs. AWS comparison.
Smashing Boxes is a web and mobile app development company know for creating a lasting experience through bold design and disrupting the status quo. We are entrepreneurs and craftsmen first, and a digital creative agency second. Inspired by our visionary clients, we transform ideas into innovative web and mobile applications. Take a look at our work.