Firebase or Heroku?

Firebase or Heroku?

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.


Join the conversation...



Submit

i am just learning how to code and firebase made it really easy for me to publicly host my work. i didn't have to worry about a database and they have a nice built in API for storing information for my app. i have never used heroku but have a hard time understanding how that would be easier than firebase in terms of quick MVP deployment.
Posted by Tessa H on May 11, 2017
Firebase is a front end developer's dream come true. it abstracts complicated backend architecture so you can focus on building out full stack solutions with limited backend experience. With that said, Heroku is a more appropriate platform for running an actual business. It requires more understanding of backend technologies but gives you the flexibility you need to better control your data. Firebase does not scale well and does cost money if you start getting serious traction. Heroku isn't free but is better equipped to help you deploy and host a full stack solution.
Posted by Venu Rangarajan on May 4, 2017
i've been using heroku for years and don't even know what Firebase is. i can say that heroku makes deployment super simple and is great for spinning up / hosting quick mvp's on publicly available domains.
Posted by Johnny NoLastName on May 1, 2017
i love using heroku but was also built on rails myself...heroku has traditionally played very well with Ruby on Rails so I stay loyal.
Posted by Jasmine on April 7, 2017
can someone please explain to me what firebase even does. i totally understand that heroku is used for hosting and that firebase handles oauth really well, but outside of that i don't see how you can completely host something like a node.js project on firebase? do they give you the ability to alter the backend?
Posted by Tony B. on March 22, 2017
i agree with the black box idea. firebase makes things easy but you are giving up more control to Google. Heroku makes prototyping pretty easy as they offer free SSL endpoints etc.
Posted by Samantha on March 18, 2017
i see this more as an apples and oranges comparison. heroku is great for hosting rails / node.js apps on public facing servers etc. and firebase is more of a one stop shop as a backend service. firebase is more progressive with it's integrations with android and ios. firebase is great for hosting and less expensive than heroku. firebase does more for you on the backend whereas heroku is simply a hosting platform of sorts. heroku does have addons that make it easy to spin up a say a mongodb instance but again apples and oranges...
Posted by Sudeer B on March 16, 2017
Interesting read. Thanks for this haven't found much on this yet
Posted by Jamie W on March 12, 2017
Firebase makes oAuth extremely easy. You basically don't have to worry about the back end. very true that it is perfect for MVPs etc if you want to test the viability of something before moving into more expensive hosting solutions (like heroku).
Posted by Brenda Mathews on March 6, 2017
Heroku gives you more flexibility on the back end...at least from a server standpoint
Posted by Alex Rinder on March 4, 2017
Firebase and RethinkDB are designed for reactive programming, i.e., new data in the database updates the view in realtime without the user clicking to send an HTTP GET request. Conversely, when the user changes data in the view the database updates instantly, without the user clicking to send an HTTP POST. Heroku can't do this. For example, you can easily write a multi-player game with Firebase. As for Firebase's "server side limitations," with Firebase you don't need a back end. I write my apps in Angular with all my logic in the web app, i.e., in JavaScript running in the browser. My router is in Angular, my templates, my controllers, everything. My apps are so fast that users think they're native. With Heroku your users will click and wait while HTTP requests go back and forth.
Posted by Thomas David Kehoe on February 22, 2017
firebase does great with handling things like oAuth, etc. It's a Google product, so being an early adopter may not be the dumbest move...
Posted by Steve Razine on February 21, 2017
firebase is good for mvps...i would argue that (in some ways) this is comparing apples to oranges...
Posted by Jarred Billmont on February 21, 2017
Heroku is better if you're actually trying to run a business with your platform. It gives you more flexibility on the back end. Firebase has its value, especially for quick MVPs. In some ways, Firebase caters better to the front end developer, but Heroku gives you and your company more freedom.
Posted by Todd Jacobsen on January 22, 2017


More by the stackchief