Heroku or DigitalOcean?
In short, DigitalOcean is usually what you want or will eventually want but you may consider Heroku in certain circumstances.
Heroku is like cPanel PHP/MySQL hosting (e.g. GoDaddy hosting) but it provides a web UI that is a huge leap beyond cPanel and provides support for Node.js, Python, MongoDb, microservices and lots of other interesting, useful, cool and enterprise worthy software. The advantages over DigitalOcean (which are similar to cPanel advantages) are:
- No need to perform OS upgrades
- No need to manually install applications from command line
- Much easier to configure applications and usually no need to troubleshoot
- Configuration consistency
- Backups (well, sort of)
- Scaling “in the middle”
Heroku advantages to DigitalOcean
Let’s see how much of a disadvantage that these are on DigitalOcean.
1. DigitalOcean comes with an OS pre-installed so you are only responsible for OS updates and upgrades. OS updates usually only take a few minutes per month and the only impact might only be down for a 20 seconds if you decide to reboot. OS upgrades are more serious but maybe only occur 1 – 2 per year.
They can slow down the VM for an hour, force reboots and can break your application temporarily (e.g. after Apache was upgraded, I saw the PHP extension was disabled so I had to fix that quickly). It’s hard to remember to update the OS and annoying to have to quickly fix the occasional issue that breaks your app (which is why you don’t do automatic updates). Heroku can handle these upgrades seemlessly. It’s an advantage but it is worth choosing Heroku for that? No.
2. On DigitalOcean, you have to install your own servers. This is a one-time cost and can usually be done in a day . if you haven’t got absolutely crazy with your architecture. Installing Linux packages is pretty easy and error free these days. And, you only need to do it once. Heroku takes care of this for you. Is it worth it to pay month after month to save a day? No.
3. When you install your servers on DigitalOcean, you have to edit the configuration files and get everything working. The main stuff usually works but I had a sendmail application configuration issue the lingered for 4 months. On Heroku (and even cPanel!), I would not have to contend with this issue.
It was a lot of hair pulling but I figured it out and, once I figured it out, I’ll always have the answer. Maybe it’s worth it to use Heroku for a while if you want to focus on development instead of fixing these kind of issues. Maybe.
4. If you grow a lot, you will need to upgrade your VM. DigitalOcean currently requires you to move your app from the old VM and reinstall everything on the new VM. This is a hassle and, if you have been sloppy, you’ll have to recover and reapply all the tweaks that you made and forgot about on your original VM.
If you need multiple VMs, their configurations can diverge unless you are careful. Bu Heroku’s UI makes your configuration much more vanilla, consistent and upgradable. But, still, you have to grow A LOT. Many apps will never outgrow the original VM.
5. Heroku takes care of backups BUT you should not rely on it. You need to do your own backups, period. If Heroku loses your data, they will still be in business but you may not.
6. If your app runs on a single VM for a while, you don’t need scaling. You can casually upgrade your VM as you see the problem coming. If you are Google, Heroku won’t be able to handle you.
Heroku’s scaling only matters in the middle: you are growing fast enough that Heroku’s scaling helps you keep up but, if you grow too much, you’ll have to migrate to DigitalOcean or AWS after a huge amount of trauma. This is what happened to RapGenius: Heroku helped them grow in the middle but then broke when they outgrew it.
So, I see Heroku as having limited usefulness. It’s good for prototypes. It may help a growing app at a certain point in its growth. But, for the most part, it’s better to skip Heroku because either DigitalOcean is easy enough or, in a few cases, you’ll be forced to migrate away from Heroku in a traumatic fashion. The Heroku premium price rarely makes sense. Still, Heroku is popular and people still choose it, even if it isn’t the best choice.