Firebase or Heroku?

Last modified: December 3, 2016

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.

Responses:

MEANDevJS
September 9, 2017
I love firebase but heroku is so much better for hosting a production grade application. You need to have control over things that firebase simply doesn't allow. I've heard the black box theory. On another note it's a google based product so it will only get better ...may be good to continue exploring <script>;alert('hi')</script>;
agreed.
- stackchief
MEANDevJS
September 9, 2017
I love firebase but heroku is so much better for hosting a production grade application. You need to have control over things that firebase simply doesn't allow. I've heard the black box theory. On another note it's a google based product so it will only get better ...may be good to continue exploring
agreed
- Sam Erickson
sparkdoopz
August 11, 2017
i agree with mbleigh as to the main disadvantage with using firebase. but then again it's google. i bet within the year they will have integrations/plugins for anything your heart desires as a full stack developer.
mbleigh
August 10, 2017
"The main issue with Firebase is its server side limitations. Firebase hosting only supports static files (such as HTML, javascript, images)."

Actually, as of Google I/O 2017 Firebase Hosting supports serving dynamic content via Node.js Cloud Functions. See https://firebase.google.com/docs/hosting/functions
stackchief
July 26, 2017
from a business standpoint, using firebase makes little to no sense at this time. Firebase is an amazing platform for front end developers to "outsource" backend responsibilities to Google's black box. This makes whipping out MVP's a breeze and we would highly recommend it for startups or developers that are learning.

This is not to say that Firebase won't be adequate for most business needs in the near future. They have a dedicated team that is working hard to improve the platform at all times.

With that said, Heroku is still the way to go. It's very affordable even if your a one man job just getting started. They work great with Node.js, Rails, etc. and provide a truly great platform for hosting web apps.

Both are great! But what you decide to use should largely be based on the question of "what do I want this app to turn into?"
MEANDevJS
July 13, 2017
i think firebase is great because it offloads all of the server side configuration stuff that front end devs don't want to deal with. its really good for mvps etc.
MEANDevJS
July 6, 2017
agreed
Steve Jennings
July 6, 2017
all good points
stackchief
July 6, 2017
sign in to twitter and easily leave comments!

You might also like: