Photo by Lum3n (CC)

TLDR: Initially only planned to use Firebase to help kickstart a side-project, ended up falling in love with it.

The Good

Beautiful user authentication API and management

One of the best (and cheapest) hosted database solutions around

Fantastic documentation

Amazing UI

Decent integration libraries

The Bad

Firebase does not fully replace a backend

Update: now with Cloud Functions , a ‘serverless’ app is possible!

Firebase SDK library is closed source

Update: Firebase has open sourced the SDKs!

The Good

Authentication

Chances are, if you’re building an app, you’re going to need some form of user authentication and management. Let’s take a look at how you can add Google Sign-in to a (Firebase-configured) app:

Well… that was easy. The more discerning readers among you will notice that the syntax isn’t that far from the (non-Firebase) standard Google Sign-in flow. However, what isn’t available with the standard Google Sign-in, is a fully-fledged backend where you can create, delete or temporarily disable users to your heart’s content.

Pushing my digital design skills with blurred boxes

It’s not possible to talk about JavaScript user authentication frameworks without mentioning passport.js, by far the most popular and widely-known solution out there. However, it’s important to remember that passport.js only runs on Node.js, so if you’re looking for a client-side framework, Firebase is the way to go.

Database

Initially, I only planned to use Firebase Database in the early stages of development. I saw it as a convenient option, as I didn’t have to set up my own MongoDB instance, but I was constantly aware of becoming too dependent on it. My main gripe was that it’s a proprietary standard and I didn’t want to outsource control of my data.

A few months into the project I decided to finally set up my own MongoDB instance. I realised my requirements were:

~99.9% uptime

Excellent performance

Easy application of security updates

A front-end to view the data

Automated backups

Some important context is required here; the side-project I’m working on isn’t a technical hobbyist-type project, it’s a business. My aim is to make a product available for real users to use (and eventually pay for). Therefore I wasn’t keen on the idea of spending an extra month working on configuring a database setup to meet the above requirements.

Fortunately, there are a number of hosted database solutions available. One such solution is MongoDB Atlas (from the team who make MongoDB). This was starting to sound like a good option until I saw the pricing calculator. The cheapest instance is $0.09 an hour, or ~$64 a month. Compare this to the Blaze plan with Firebase Database, which meets all of the requirements above (including automated backups!) and costs only $0.026/GB. With my usage of a few hundred users (saving text-only data), my last monthly bill came to $0.30. Google is no stranger to storing data, so it makes sense they would be able to provide the most cost-efficient storage plans for a hosted database.

My remaining qualm was that Firebase Database is a proprietary standard, which I was apprehensive about until I discovered that it’s possible to export your entire database at any time to a JSON file. That means you’re free to leave whenever you like and transfer your data to another NoSQL database program. To summarise, staying with Firebase Database would give me a cheap, secure, hosted database with guaranteed uptime, along with the option to leave at any time. My search for a hosted database provider was over!

Now let’s check out how you can go about saving data to Firebase Database:

Yep. It’s genuinely as simple as that.

Now to retrieve some data:

So pretty I want to cry.

Now also feels like a good time to mention that Firebase Database automatically syncs your data across clients in realtime. That means if you have your app open on both your phone and your laptop, and you edit some data on your phone, the change will automatically be reflected on your laptop.

Documentation

It’s not uncommon to see people complaining about Google’s “poor documentation” on sites like Reddit and Hacker News. After spending time with the Firebase documentation, I couldn't disagree more and I would suggest anyone who still holds Google in a poor regard to check it out.

Amazing UI

Screenshots can only do this so much justice. It’s free to create projects with Firebase so if you’re curious, sign up and “have a butchers” for yourself.

Integration Libraries

There’s certainly no shortage of libraries available. That being said, I avoided the React library as it seemed quite out of date and heavily dependent on mixins, which are now considered harmful to use in React.

The two libraries I did make use of were the Web and Node.js Firebase SDKs. Both libraries integrate well with the Firebase Auth service making it a breeze to save user-protected data to the database.

The Bad

Firebase does not fully replace a backend