Alex Bosworth's Weblog

developing software, living the expat life in beijing, other fun stuff!

previous projects: alchemy, swik, open source stuff, now adylitica.

Should I use Heroku

To Heroku or not to Heroku, that is the question.

(I should preface this with the info that the CEO / now General Manager of Heroku was my previous boss)

I personally love building web services, but hate configuring Linux boxes, and database and web servers.

That is why when I build new services, I gravitate towards outsourcing the configuration and database/web server stuff, or using a solution where I can control and understand all aspects of how it works because it is either simple or familiar.

Examples of things I like because I can understand how they work and I control them

  • Memcache
  • Node.js
  • JQuery
  • Nginx

Examples of things that work by complicated or magic rules and I try to avoid

  • Ubuntu, CentOS, etc
  • MySQL, Postgres
  • Any ORM solution
  • Apache

Examples of things I outsource because I don’t want to worry about them

  • Amazon EC2 / S3 / SimpleDb
  • Tumblr
  • GMail
  • Github

So where does Heroku fit in for me? I am actually very wary about outsourcing, because there is a good chance that an outsource partner will change the deal on you at some point unexpectedly, not behave as you expect or hope, or just disappear.

I have in fact always been burned by outsourcing:

  • Amazon changed their SimpleDB API and said I must change or my App will break. If I control a solution only I get to decide when I must change.
  • Tumblr has let me down by not really improving anything that I use on their site.¬†
  • GMail has had progressively worse usability with every update, and they failed to make a decent iOS App because they are putting their Android strategy ahead of their users’ needs.
  • Github’s pricing plans don’t match my business needs, they are focused on other kinds of businesses

But all of these negatives don’t mean I want to do everything myself, the world is not a black and white place. Not outsourcing has costs too.

So where does Heroku fit?

In the beginning, I thought the idea of Heroku was wrong: Amazon is already doing for me what Heroku is selling.

But Node.js changed everything for me. Node.js is a framework that is very bare-bones. You have to do a lot yourself. When I switched to Node.js over a year ago, I started work on a scalability system for Node.js where I could reduce process failure vulnerability and increase my ability to easily scale beyond a single machine.

I did this all on my own server, an EC2 instance that cost money every month to run, although thanks to Node.js’s great performance characteristics, was not stressed at all.

But eventually I saw a series of factors that made Heroku the right choice for me:

  1. Node.js support (one of the few vendors, even Joyent who invented node.js wouldn’t let me pay them to host my apps on their platform)
  2. Salesforce.com owns Heroku which means it’s not going to go bust anytime soon
  3. There is incredible community support for Heroku
  4. Heroku is free to start, and for me even with tens of thousands of users it’s still free
  5. Heroku’s dyno system is almost exactly like the system I built for myself, only more reliable and better
  6. Heroku is git based and has a very simple command line interface
  7. Heroku is hosted on Amazon EC2, which I already was using and trust
  8. Heroku’s pricing model is incredibly friendly to Node.js, almost troublingly so. The model of pricing is based on the idea that web servers ‘block’ on requests - so to get more simultaneous requests you will have to pay more money. But node.js doesn’t block on requests, so it’s like getting thousands of servers for free.
  9. Heroku’s customer support is very friendly and good, even though I’m not a big customer
  10. Heroku has a nice logging command
  11. It takes only a single command to scale up and down

OK, so I made the full switch in August of this year. I said before: every outsourcing solution will burn you. How has Heroku burned me?

  1. Heroku makes an implicit and sometimes explicit promise that you can just write code and stop worrying about the server characteristics. This is false, for example if you use too much memory in a single process Heroku will start presenting errors to users, and this threshold of memory is easily reachable in practice.
  2. Heroku Apps are blocked in China - I live in China, I want a service that isn’t blocked here. China is projected to become the biggest economy in the world within 5 years, it’s an important market.
  3. Heroku’s failure rates have an impact to users: about 0.05% of my requests this month failed
  4. Heroku’s add-on system is weird and scary
  5. Heroku hasn’t updated their version of node.js in over 6 months and is¬†incommunicative about when they plan to update.¬†
  6. Heroku doesn’t support HTML5 websockets

Given all of these drawbacks, should I still be using Heroku?

Yes, I think Heroku is great. The costs are definitely outweighed by the benefits.

And one of the best features of Heroku is that I could switch away quickly if I ever change my mind.

Comments (View)
blog comments powered by Disqus