Firebase or Heroku?

Heroku and Firebase are both hot options for web hosting. Both have great CLIs that make deployment possible in just a few commands. They offer SSL, custom domains, backend storage, and everything else you'd want for your application. Below we explore the pros and cons of each, providing insights as to which one is right for you.

Why Firebase?

Firebase takes a huge burden off developers from the server standpoint. It automatically configures your backend storage, which is a simple NoSQL database with a supporting GUI for manual entries. Firebase automatically provides SSL encryption. You can also link it to a custom domain purchased from GoDaddy, etc.

Firebase is also great for authentication. Through its robust API, Firebase abstracts complicated OAuth logic away from developers, making authentication via Twitter, Google, Facebook, etc. a breeze. The platform also has built in Google Analytics and AdSense support, saving developers the hassle of including SDK's and external libraries for tracking and advertising.

Issues

The main issue with Firebase is its server side limitations. Firebase hosting only supports static files (such as HTML, javascript, images). You can't run any server side node scripts inside your own server instance. You are completely relying on Google's 'black box'. This severely limits your abilities to control backend operations. Firebase does offer some interfaces for server side configuration, such as altering HTTP header information, however it's still limited in this regard.

Why Heroku

Where Firebase struggles, Heroku excels. Heroku apps are run in separate application containers called 'dynos'. These dynos allow developers to deploy apps within their own server containers, giving them much more flexibility on the backend. This makes server side routing, custom 404's, redirects, etc. much easier to deal with. Sure it may take a bit more knowledge of how servers work, but you will appreciate the independence it gives you.

Heroku also provides superior logging. Using the CLI, you an easily see real time log reporting for your app. This makes troubleshooting and debugging easier.

Although backend storage is slightly more complex with Heroku, it wins again in flexibility. Heroku provide various add-ons for Postgres, Mongo, MySql, etc., making it simple to connect to virtually any backend data engine. An additional advantage is your data is stored separately, giving you more control over front/back end responsibilities.

Issues

Heroku gets costly fast. It does offer free starter dynos (and more recently SSL), however ties you into monthly payments in unexpected ways. For example, Heroku may offer free SSL, but only if you're paying them $7 for a 'Hobby' dyno. If you want to host your app right on Heroku, be prepared to pay up a bit.

Conclusion

Which is right for you? It depends on what you're trying to do. If you want to generate a quick MVP with a reliable backend, Firebase may be the way to go. If you want more fundamental control of backend processes, you may want to invest the extra time and effort into Heroku. Keep in mind that both are well established and extremely easy to implement. It all boils down to sacrificing flexibility for the convenience of Google's 'black box' magic.

Your thoughts?