With the increasing importance of cloud computing, services like Amazon’s EC2 on AWS and Heroku are coming under more scrutiny. Even better for the consumer, the increasing number of such services means more choice in the market. But with this increased choice comes an increased level of confusion, because it’s often difficult to do an apples-to-apples comparison of the various services. Even worse, their offerings aren’t strictly in the same domains, but let’s take a stab at it.
Heroku vs AWS overview
EC2 is the major component of Amazon’s cloud offering AWS, together with a bewildering plethora of other services – RDS and MongoDB for database, S3 for storage, OpsWorks and Elastic Beanstalk for deployment/ config management, and several others that will give you a headache if you try to learn them all at once. But the main point is that EC2, or rather AWS, is a proper IaaS platform – it mainly gives you bare machine components. You then use those components to build your web applications, databases, deployments - whatever software environment your heart desires.
Heroku, on the other hand, is a PaaS solution. You get a ready-made environment in which you push code and can make a restricted set of config changes to get your app up and running. It is not as open-ended as AWS, and that’s both good and bad. Good because it means you can migrate and start your apps relatively quickly on Heroku. Bad because it locks you into Heroku’s way of doing things. Oh, and if your apps don’t run on their ‘platform stack’ then you’re plain out of luck. With Heroku (and other PaaS’s) you don’t get access to the underlying infrastructure, because that’s not the point. The point is to get a ready-made environment without the hassle of machine setup. In this way, you see that Heroku and EC2 aren’t strictly competitors in the same market space. So you won’t be surprised to hear that the Heroku infrastructure is actually hosted on AWS!
Cost and Pricing
This is one area where things are not clear cut at all, and making a direct comparison isn’t easy. And to complicate things further, the cloud pricing wars have been on in earnest for years now, with instances of price reductions being announced by Amazon, Google and Microsoft, and the situation continues to evolve. We could say that it's $0.05/hr for a dyno hour, compared to $0.025/hr for an AWS micro instance or $0.09/hr for an AWS small instance. But it’s not that simple and tied up in a neat little bow.
To start with, both offer a free virtual server for tiny, basic setups. In EC2 this is called a micro instance, and Amazon entices new customers with a free micro instance for the first year (0.6 GB RAM, unlimited swap up to your storage limit, 160GB storage) and all this costs roughly $15 a per month (on demand). Heroku’s server is called a dyno, and your first dyno is free for perpetuity. Great, right? Er, not so fast. Remember, a basic dyno won’t be able to do very much (512 MB RAM, 1GB swap), so you’ll likely need additional ones if your application has a larger memory footprint.
Heroku is set up to scale horizontally out of the box with no additional configuration and additional dynos cost $25-$50 per month depending on the dyno. In the early days, Heroku only used ephemeral storage volumes which meant you had to store any data generated by the application somewhere externally like S3. This has now changed, with database options like Heroku Postgres allowing you managed SQL database as a service to persist and manipulate data. You also get health checks, off-premises storage, and daily backups. Follow the link below for a more in-depth analysis of the pricing structures:
https://www.quora.com/Heroku/How-easy-is-it-to-get-off-Heroku-once-you-grow-out-of-it
Platform Model
As mentioned, AWS is an IaaS platform, and Heroku is a PaaS platform. Heroku provides you a limited range of languages, databases and environments to work with (Linux operating system, Node.js, Clojure, Scala, Ruby, Java, PHP, MongoDB, Cloudant, PostgreSQL). But the general consensus is that things run very well within that limited range, especially for Ruby-based apps and platforms like Ruby on Rails. For instance Heroku’s simple horizontal scaling means that the load on your app is automatically spread among all your dynos. The house is already built, so your role is mostly to just move in and arrange your furniture to make it a home, so to speak. The disadvantage is that your choice is severely limited. Also, you are locked into Heroku’s proprietary file system. This means any files you store on your server will disappear after the server is shut down, and it is not guaranteed to be on other servers your application is running on, and no other services can be run on dynos except those on the pre-approved Heroku list. There are hacks online to enable you to run unsupported platforms on Heroku, but the mere fact that you have to resort to hacks is still a cause for worry for many.
Amazon AWS is akin to having the wood, concrete, land and interior décor materials. Now build your own house. It is a much more powerful and flexible setup, but if you don’t know what you’re doing you are almost guaranteed to mess things up. You need a higher level of skill to set up and administer the OS and deploy your own apps, although things are made much easier by the fact that there is a huge number of preconfigured machine images of popular platform combos: Linux+Apache+MySQL, Windows Server+SQL Server, Unix+Oracle DB, and so on. Oh, Amazon also supports Windows and other Unix flavors, unlike Heroku. But AWS cannot scale horizontally as easily as Heroku.
To get your code running on AWS and looking a bit like a Heroku deployment, you'll want some EC2 instances - you'll want a load balancer / caching layer installed on them (e.g. Varnish), you'll want instances running something like Passenger and nginx to serve your code, you'll want to deploy and configure a clustered database instance of something like PostgreSQL. You'll want an app deployment system with something like Capistrano, and something doing log aggregation. That's not an insignificant amount of work to set up and maintain. With Heroku and its out of the box components such as Heroku Postgres, the effort required to get to that sort of stage is maybe a few lines of application code and a git push.
Scalability and Availability
AWS outages are now legendary (https://www.networkworld.com/article/2160902/amazon-ebs-failure-brings-down-reddit--imgur--others.html). Because of the sheer size of AWS and the number of high-profile websites it hosts, especially those with huge user bases like GitHub, Reddit, Imgur, Foursquare, Pinterest, Netflix, etc, any AWS downtime makes the news. And we mean mainstream news, not only in the tech world. The AWS interface is relatively easy to use, offering both a useful GUI management console for setup and monitoring, as well as a CLI for more advanced config. Corporate and community support are both excellent; not surprising given Amazon’s size.
Heroku, although actually running on top of AWS appears to fare better in the service outage department. It has only suffered one major embarrassing outage in June 2012. It is git-based, so deployments are a snap, and the user community is particularly active. The CLI is blissfully easy to use, and users of both platforms report they are happier with Heroku machines’ performance. But Heroku Apps are blocked in China, for some reason that most likely has to do with SSL, security, and the Great Firewall.
Popularity
When it comes to popularity, there’s no denying the overall supremacy of Amazon Web Services in the cloud computing marketplace. Amazon moved into this market with force and determination at a time when the market was very new. Over the years, they invested heavily into R&D and made their cloud services available in regions right around the world. Given the depth of their investment into this market, they are able to meet the needs of the widest set of computing organizations and businesses, which accounts in large part, for their unparalleled popularity, far outstripping giants like Microsoft Azure and Google Cloud, let alone a much smaller competitor like Heroku. An estimate from BuiltWith counts over 9 million websites live on the internet with AWS providing cloud hosting services or some other part of the stack. When you consider how many other sites simply go undetected due to the limitations of the tracking technology, it’s clear AWS has a super impressive user base.
Contrast this with Heroku’s appeal, which, while strong for its particular target market, remains quite selective, making Heroku less of a direct competitor for AWS EC2 than would be the case with cloud providers like Microsoft Azure. For Heroku, BuiltWith counts just over 100,000 websites, with over 60,000 of those having used Heroku in the past but not at the time of record. The numbers, while rough estimates at best, nevertheless give a valuable portrayal of the magnitudes of difference in the user bases of these two cloud computing technologies. The difference in usage numbers also bears clues to another essential difference: AWS will do more things for more people than Heroku ever could, or even aspires to. While AWS aims to provide the full spectrum of cloud computing requirements for any and all tech organizations in the world, Heroku, as a smaller, nimbler, niche-focused upstart, aims to dominate only in serving the app development needs of nimble, small, startups building highly scalable web and mobile apps using programming languages and rapid application development technologies that include Rails, Node, Python, and the like.
Storage and Database Options
There are important differences in database and data storage options for AWS vs Heroku. If you get right down to the root of it, you can get your selection of database to run on either of these two cloud providers, whether that’s a traditional relational DB like PostgreSQL, a No-SQL option like MongoDB, or a key-value store like Redis. How Heroku and AWS actually get this done, and how flexible the setup will be, is where they take sharply divergent approaches.
On Heroku, data storage is set up for you right from the start based on your app’s storage needs and your selection when setting up your application. Your standard options there are PostgreSQL and Redis. Pretty limiting, you say? In reality, Heroku understands that there’s endless demand for other data storage needs, such as a wide plethora of No-SQL and SQL databases. To accommodate this usage, an add-on system is in place, allowing you to use your favorite technology with Heroku. Vendors have made this add-ons, and you might be on the hook for subscriptions per add-on with the vendor, but it does allow you to use the data storage system you prefer, while keeping the basic Heroku options simple.
AWS is much more flexible where data storage is concerned, because it has solutions in place to accommodate whatever data store you decide to use. With AWS’s ecosystem, you don’t need to rely on add-ons that may be discontinued by a third-party vendor at any time, you can use, instead, the canonical open source database systems you would use if you were hosting your apps in your own on-premises data center. Most organizations will find their data storage needs well-matched to one of AWS’s multiple specialized services for data storage. If you want full-featured and flexible setups for complex data storage and retrieval needs, AWS, with its multiple, highly flexible options, is superior in this regard. These options have some overlap, and compete with each other, and include:
- Amazon Aurora - relational database compatible with MySQL and PostgreSQL
- Amazon RDS - relational databases, including MySQL, Oracle, Microsoft SQL Server etc.
- Amazon Redshift - cloud data warehouse suitable for analytical workloads
- Amazon DynamoDB - fast NoSQL database
- Amazon DocumentDB - MongoDB-compatible NoSQL database
- Amazon Managed Apache Cassandra Service - managed Cassandra-compatible database
- Amazon Neptune - cloud graph database
Ease of Use
While Heroku loses out to AWS in popularity and data storage options, its opinionated, “batteries-included” approach gives it the edge when it comes to ease-of-use. Depending on your app, you can deploy it from zero to live in production within just a few minutes with no prior setup of any kind in place. Heroku’s platform has everything in place that automates a lot of the server setup and provisioning you would need to do if you were deploying your apps on AWS and its Elastic Compute Cloud service. By making the selections on your behalf, the platform abstracts away a lot of the infrastructure management so that you can focus on deploying your app and auto-scaling it in real-time without touching the underlying servers and load balancing infrastructure. Yes, it can be a bit limiting, but it’s so simple that even under-resourced, small, startup teams can use the platform without spending precious time managing their IT infrastructure. Heroku wins hands down in ease of use due to, among other features:
- Code rollback - Thanks to its build system, you can roll both code and database back to a previous state
- Github integration - Out of the box integration means pull requests spin up review apps for testing, and more
- Smart containers - A big part of what makes Heroku so powerful yet simple to use, these dynos are managed and patched for you automatically so you can simply run your apps without managing the infrastructure
- Scaling - Scale instantly, both vertically and horizontally using the command line tools (CLI) or the Heroku Dashboard
Heroku has built in a seamless platform that comes preconfigured for you so you get a whole suite of amenities out of the box, including health monitoring and other advanced functionality, that would not be trivial to set up, provision, and configure for yourself on AWS. This is one area where its approach will make life so much easier for devops teams, especially at smaller startups or small projects in the enterprise. Ease of use is a compelling argument for product-focused startups where infra-structure per se is not the differentiating factor, and it makes sense to use Heroku over AWS in order to move faster.
For its part, AWS has realized its large ecosystem can get unwieldy, and it has sought to make the AWS interface manageable. Individual AWS services try to limit the complexity where possible, for example by providing managed services like AWS Elastic Beanstalk so you don’t have to do it all yourself. However, in the interests of maintaining flexibility and giving different organizations and their devops engineers the ability to set up the exact hosting system that works for their apps and unique needs, AWS remains one of the most complex and also the most flexible cloud platforms. AWS complexity seeps through into other areas of the user experience, such as billing, where many teams have a hard time planning and managing their exact AWS costs. Inevitably, AWS is a more powerful and diverse ecosystem with more services, and all that extra optionality comes with a bit more complexity and a steeper learning curve.
Trends and Future Growth
The future of both Heroku and AWS looks exciting, but some common challenges could emerge. Both of these cloud providers should benefit from deep and far reaching adoption of cloud computing, both at small startups and large enterprise businesses. The economics of cloud computing mean, typically, lower costs for teams, time savings, and access to options that might not be available if a team insists on hosting their own servers on-premise. In terms of the audience that will gravitate to these two platforms, given Heroku, now owned by Salesforce, sticks to its roots of targeting smaller organizations with well-defined needs, it should continue to be a compelling option for such startups. AWS has a much wider target market and should handily win the competition for large enterprises and startups that have grown beyond the level where the need for flexibility begins to outweigh any benefits that a simpler ecosystem might provide.
In terms of challenges, both of these platforms must adopt to the rapid pace of change in the cloud computing space. Tech best practices change quickly, and in recent years, containerization and technologies like Docker and Kubernetes have become popular. AWS has taken steps to attract Kubernetes users with its Amazon Elastic Kubernetes Service (EKS). EKS looks promising but faces stiff competition from Google Kubernetes Engine (GKE), Red Hat OpenShift, and others. Kubernetes services also offer an alternative to startups looking to move off Heroku and lower costs while being able to set up more complex configurations, in other words, teams that have outgrown Heroku’s comfortable defaults. That said, expect both Heroku and AWS to evolve in line with where the state of the art goes in cloud computing services.
Summary
So Amazon vs. Heroku? You decide for yourself, based on whether you prefer your house pre-built, or you would like to work with the architect to tailor it specifically to your needs. Also see the excellent comparison chart below: