About Firebase & When & Where to use it

About Firebase & When & Where to use it

ยท

9 min read

Firebase is Google's mobile application that lets us use stuff like :

  • Analytics
  • Authentication
  • Databases
  • Machine Learning mobile SDK
  • Cloud Storage
  • Hosting

and much more for free! These tools are hosted on their cloud and cover many applications that developers normally have to build themselves but are too lazy to build, so they just don't. Basically, this application called Firebase has saved hundreds of working hours and money for many people's lives and I think that is beautiful. This is true for every innovation in the tech industry of course, and the more we grow the more time we have to chill in/out. I require more video game hours.

I came across firebase while building a clone app on todoist.com using React hooks and Firebase for real-time database integration and authentication. I will make an article on that soon, for now, Let's see how to actually get started with it!

It should be noted that Firebase is more primarily focused on Android devices ( since android is commercially sponsored by google ). On IOS platforms the features may not always go hand in hand as it is with Android studio. However, firebase keeps changing, and comparing 2018 and 2020 versions the main product is barely visible.

s_6E91A7196F73A07C3A70C03D9F4E82BC71FAF243C76910FEEA4185813B62F006_1613570532448_image.png Firebase has garnered a good reputation around the community and is a go-to option for beginners as well as experienced developers for the database backend. It is normally used in small to medium-sized projects that require a small database with a limited number of users.

As said earlier, these services are hosted on the cloud, meaning these are fully maintained and operated by Google. There is no middleware involved since Firebase interacts with our backend system directly so all we have to do is write the code to query the database in our client app.

Firebase has basically made traditional app development extensively easier.

  • Traditionally we needed to write both the backend and frontend software ourselves, all the frontend code does is invoke the API endpoints exposed by the backend, and the backend code actually does the work.
  • With Firebase the traditional backend is bypassed, putting the work into the client app. Administrative access to these services is provided through the firebase console.

0_DylbZPWyXT7S0Fn5.png

A lot has gone into Firebase and while it all sounds overwhelming, it's not a tech stack lel, just a service. Think of it as the "Free Backend Service". That sounds so liberating.

When to actually NOT use Firebase

The first thing you think of will probably be something that can be built with Firebase. But when should we not use it?

  • If we plan our application to last for the long term (+5 years)
  • If our application is not extremely data-intense
  • If our project is bigger in scale, we might want to reconsider the option as it gets quite pricey once your backend processes/database queries limit is reached.

That being said, there are different scenarios to consider with any app you build with firebase and it all depends on questions like what kind of data our app will actually operate on. For example, Most apps will deal with text strings that take a very small amount of data, images would be a step up, and videos an even bigger leap. According to more experienced users, before worrying about how to deal with 1M users on our app, we should think about how the app will fare for 1-10k users. I know, feels arrogantly optimistic to think that we will get that many users lel, but learning about scalability management is always cool.

In Firebase's case, we will mostly be on the Free tier of scalability with up to 100k users as long as we are not feeding in enormous data fields with bad scalability philosophies. But of course, on an app with +100k users, it ain't gonna be a problem cause we will more than probably be earning from it.

The Tools

0_HORJhBhTELtW9qQw (1).png Firebase services used to be categorized as Building, Improving, and Growing your app. Now it is categorized as Building, Release and Monitoring, and Engaging which I do no understand why. Monitoring user engagement is in the R&M section but then again why is it in the Engage section?! That jumbles it up. Does not make any sense to me tell me if it does for you.

image.png

1. The Tools for Building your App -- The Anatomy

The last time I used Firebase was to provide authentication to my web application and integrate a real-time database backend into my react-app and I never really bothered to look into other stuff cause I'd rather read my manga but now that I have basically ---

And yes. I was embarrassed at my ignorance towards it after I looked into the features.

2. Release and Monitoring -- Performance and Stability

This is honestly one of the coolest products to get for free, it has so much to maintain your app that I could barely scratch the surface for it. That being said, getting our applications to actually get to this stage of using these features definitely takes a lot of work, and actually doing so is a much better way to learn about Firebase than just reading some blog post about it pfft. The most prevalent tools to use in this section are --

  • Firebase Crashlytics

This monitors crashes that occur, reports them in real-time, and even provides insights to pinpoint the cause of the crash issue. This saves us a lot of debugging and optimization time!

  • Google Analytics Integration

Google Analytics to track audience retention, understand user behaviors, and to act upon them to have better insight over what updates should be made to our application

  • Firebase Performance Monitoring

This is a real-time performance monitoring tool that helps us keep a close eye on our app as we roll out new features or make configuration changes. Performance monitoring also gives us control over our performance data with a customizable dashboard that makes it easier to focus on the most important metrics.

  • Firebase Test Lab

This is a cloud-based app testing infrastructure. This is amazingly convenient as it lets us test our app on all devices that we want it to be supported on to get the right idea of how it is going to perform in the hands of the live users.

  • Firebase Remote Config

This lets us make dynamic changes to the behavior of our app without having to publish an update to our app. The general idea here is that we define a bunch of configuration parameters in the Firebase console. Then our apps use an SDK to periodically fetch those values and make use of them as required. The way this feature really shines is through its ability to define conditions for each parameter. This helps us implement a number of useful features in our app, including giving high-value audience members a premium experience, or infrequent users an incentive to stay.

  • App Distributions

This service makes distributing our app to trusted testers convenient. By getting our apps into testers' devices quickly we can get feedback early and act on them accordingly. Along with Crashylytics is our apps, we can get accurate information on the growing stability of our app so we know when it is ready to be released for everyone. This service is still in the ฮฒ-testing phase.

3. Tools for Enhancing Engagement

As the name suggests, this service takes part in optimizing our app in terms of user engagement. This helps us understand our users in order to better support their needs and retain them. These products are mostly focused on mobile apps. On an upper (paid) tier Firebase provides cool extensions to help us build our apps, add functionality and deploy faster. There are too many to list here but the following are the most relevant features --

  • Dynamic Linking This allows us to organically grow our app by deep linking users to the right place so they can find and share content

  • In-App Messaging Encourage active users to complete key in-app actions with targetted and contextual messages.

  • Cloud Messaging This honestly feels exaggerated to be free at this point. Sending targeted, automated, and customized push notifications to re-engage users for free.

  • Predictions This service applies the power of machine learning to predict future user behavior. This gives us basic insights into users that are likely to churn or spend so we can make informed product decisions.

  • Translate Text We can translate strings in our Firestore into multiple languages because the source language of the string is automatically detected using the Firebase cloud translation API

  • Delete User Data A data management feature that automatically deletes a user's data once the user is removed from our authenticated users. We can configure this extension to delete user data from any or all of the following: Cloud Firestore, real-time database, or cloud storage. Triggering the extension to delete data is keyed to the user's UUID, which is unique to every authenticated user.

Conclusion

Alright, that was a decent amount of text ( I feel like I overdid the embeds ). I know I have left out some of the features, as I neither feel obliged nor qualified enough to understand them without actual implementation. Anyway in summary let us look at what we actually know from this ---

  • Firebase is google's mobile application that even though advertised as cross-platform has its features more often than not emphasized towards android. But there are always enough features to look around unless we are going large scale.

  • TIME. Firebase saves us TIME and MONEY. Like so much of it. The extent to which the above features go is honestly astounding

  • We hardly ever need to use all the features Firebase offers but it is always good to know what's there

  • Even with all the features, they are easy to implement into your project with the SICK console that firebase offers.

  • Anything you think of can probably be made using Firebase. So don't stick to lazy applications that get recycled over and over. I am looking at a mirror while typing this.

  • If you are looking for contributing to Firebase Open Source projects do check out the article below

ย