You may have heard of the amazing Google Firebase platform. But did you know that Firebase offers some of the best services out there to develop fast, robust, and secure apps? That means that Firebase is a great idea for anyone who wants to build amazing apps. In this blogpost, I will give an overview of this great Google platform. Some of the major topics that I am going to cover in this blogpost includes
- What is Google Firebase?
- Understanding Core Firebase Services
- Firebase SDKs, Frameworks, Helpers, and Utilities and
- Why and Why Not Use Firebase?
By the end of this blogpost, you will have a general understanding of this platform, and you can dive deeper into any of the Firebase services.
What is Google Firebase?
In this blogpost I am going to cover about the big picture of Google Firebase. But before I go over it, how did Firebase become what it is today? Back in 2011 before Firebase was Firebase, it was just a startup called Envolve. As Envolve, it provided developers with an API that enabled the integration of online chat functionality into their website. After releasing the chat service, the founders found out that it was being used to pass application data that weren’t chat messages. Developers were using Envolve to sync application data such as game state in real time across their users. So they decided to separate the chat system and the real-time architecture that powered it. And after three years, Google acquired Firebase. But what is Google Firebase today? Today Google Firebase is a platform that helps developers to quickly develop high quality apps and grow businesses. In this section, I am going to cover the benefits of working with Google Firebase. Is Google Firebase integratable with other services? And most importantly I am going to go over the main problems that Firebase solves for us.
Working with Google Firebase
Working with Google Firebase is really easy and fun. And that is because Google experts have put a lot of thought and effort to do it so. But why would you want to use Firebase? By using Firebase, we can build apps fast because we don’t need to manage the infrastructure. This platform is backed by Google, so it means that it is a trusted platform. Also, it is important to mention that Firebase is one platform in which you can perfectly integrate different services with each other. Firebase as a platform offers different services to build better apps, to improve app’s quality, and to grow your business. One of the services that helps us build better apps is Cloud Functions . Now Cloud Functions as a Services offers us functions that can be triggered by different events from different Firebase products or services, Google Cloud Services, or even third parties using webhooks. Another service is the Cloud Storage, which is a great service that can be used to store and share user-generated content. I am going to go over in more detail about these services and more in the upcoming sections. So now that we have built our app, it is important to improve the app’s quality. And for that, we can use the Crashlytics, which is a primary crash reporter for Firebase. And to grow the business, we can use Firebase services like Predictions, App Indexing, and much more. Before I jump into the next part, it’s important to mention that Google Firebase integrates well with a lot of very useful apps like, for example, Google Ads, AdMob, Google Marketing, Data Studio, BigQuery, and Slack.
Challenges Made Easy with Firebase
When building robust applications, there are a lot of challenges that we need to face along the way. When building apps, it is important to send out to your customers or users the latest and the greatest version of your app. But rolling out new features progressively is not that easy. Also, having a robust authentication system is really important. You don’t want to get a lot of calls from angry customers because they cannot get into the system. And last but not least, implementing user-friendly chat features is not easy. But how can we use Firebase to roll out new features progressively? By using Firebase, we can get crash reporting. And by using this reporting, we can decide which issues to solve first because we can see which issues impact our users the most. We can also use remote configurations, and by using remote configurations, we can customize how our app renders for each user. So, we can roll out features gradually, run tests, deliver customized content to certain users. Another feature that we can use is Google Analytics. And by using Google Analytics, we can gain a real-time insight into user behavior. When it comes to authentication, Firebase offers the Firebase Authentication service, which offers multiple methods to authenticate the users including email and password, third-party providers like Google or Facebook, and using your existing account system directly. By using Firebase Authentication, we can either build our own interface, or we can use the existing, fully customizable Firebase Authentication user interface. Last but not least, implementing user-friendly chat features is really important. And to do so in Firebase, we can use Realtime Database, which is a great database to store and sync data between users and devices in real time by using a cloud-hosted NoSQL database. We can also use the Cloud Messaging to send messages and notifications to users across different platforms. It is important to mention here that the Firebase Cloud Messaging or FCM scales to even the largest apps, which means that you can even deliver hundreds or millions or even billions of messages per day.
In this section I have covered about Firebase Firestore, Google Firebase integrations and common challenges. We learned that Firebase Firestore is one platform which is used for fast development, and it is trusted because it is backed by Google. We also learned that Google Firebase integrates well with other apps like Google Ads, AdMob, Slack, etc. We also learned that by using Firebase platform, we can solve the common challenges when building robust applications like rolling out new features progressively, having a robust authentication system and integrating a user-friendly chat. In the next blogpost, I am going to cover about Understanding Core Firebase Services.
Understanding Core Firebase Services
We have learned so far that Firebase is a platform, and it has many services for different purposes. In this blogpost, I am only going to cover the core services. I am going to start with the Cloud Firestore, which is a cloud-hosted NoSQL document database. Then, next, I am going to cover Cloud Functions, which are functions that can be triggered by events from different Firebase services, Google Cloud services, or even third parties using webhooks. Authentication is another service that I am going to cover. Firebase Authentication offers methods to authenticate users, including email and password, third-party providers like Google or Facebook, and using your existing account system directly. Hosting is another service that I am going to cover. At the very end, I am going to cover Cloud Storage, which is used to store and share user-generated content like images, videos, text, etc., and real-time database, which is used to store and sync data between users and devices in real time. So, let’s get started.
Cloud Firestore is a scalable NoSQL document database which is used to store and sync data. But what can we do with Cloud Firestore? As a scalable NoSQL document database, Cloud Firestore supports flexible data structures. In Cloud Firestore, we can have documents which are organized into collections. And then inside collections, we can have sub-collections and so on. And in Cloud Firestore, we can nest data up to 100 levels deep. Of course, loading all the data does not make sense, right? We need to filter them, and to do so, we use queries. And in Cloud Firestore, we can write expressive queries. In queries, we can include multiple or chain filters, and we can even combine filtering and sorting. Now, it is important to mention that in Cloud Firestore, queries are indexed by default. This means that the query performance is really great. Other than these two features, Cloud Firestore is one of the best tools out there when it comes to data synchronization. Cloud Firestore uses data synchronization to update data on any connected device. But what happens when there is no internet connection? Does it mean that our app fails to work? Not with Cloud Firestore because Cloud Firestore offers offline support. This mean that Cloud Firestore caches data that your app is actively using. So the app can write, read, listen to, and query data even if the device is offline. And when the device comes back online, Cloud Firestore synchronizes any local changes back to Cloud Firestore. As developers, we never know how many people might be using our app. So when building apps, we always must take into consideration scalability, consistency, and, of course, reliable backups. As part of Google Cloud, Cloud Firestore offers a powerful infrastructure for automatic multi-region data replication, strong consistency, and almost real-time transaction support.
Another great service that Firebase offers is Cloud Functions. And Cloud Functions are used to write and deploy code that responds to Google Cloud services. But why would we want to use Cloud Functions in our apps? The Cloud Functions that we write can respond to events generated by other Firebase services, Google Cloud Services, or even third parties by using webhooks. Also, once you deploy your code, it is hosted in Google servers, which means that you never need to worry about credentials, server configuration, provisioning new servers, or decommissioning the old ones. It’s great that we don’t need to worry about scale-ups, server configurations, etc., which, of course, are not the funnest things that we as developers can do, right? Now imagine Google being in charge of these tasks. I don’t know if we can find any better. But should we worry about security? What about privacy? No worries. Cloud Functions is fully insulated from the client so you can always be sure it is private and always does exactly what you want. But how does all this work? Now the first step is, of course, to create a function. And then we need to deploy the function to the Cloud Functions in Firebase. And then, next, we can use different events, triggers, or webhooks to invoke the function. What else can we do with Cloud Functions? We can trigger or call the function directly. Let’s say we don’t want to call the function on events or triggers, we can call the function directly of course. Then we can test the functions. So before we deploy our functions to production, we can always test them locally. And we can check how our function behaves by monitoring them.
Most apps need to know the identity of a user. So based on the user’s identity, we can load only data related to that user. And Firebase offers a great service for authenticating users. With Authentication as a Service, Firebase has made it really easy to integrate Authentication in our new or existing applications. But why use Firebase Authentication? Firebase Authentication service is really easy to use and secure. By using Firebase Authentication, we can integrate in our apps email and password authentication or even social media authentication. Also by using Firebase Authentication, we can easily manage our users. We can reset the passwords, or we can even switch authentication ways or types by just one click. It is also really important to mention that Firebase Authentication integrates really well with other Firebase services.
Firebase Hosting is a Google hosting service that provides fast and secure hosting for your web applications. But why should you use Firebase Hosting? One of my favorite features of Firebase Hosting is that you do not need to worry about SSL certificates because SSL is built into Firebase Hosting so content is always delivered securely. But what can we host in Firebase Hosting? Firebase Hosting supports all kinds of content for hosting, from your static CSS and HTML files to your Express.js, Microservices, or APIs. Now, Firebase Hosting service is part of the Google family, right? And what do we expect from Google more than anything else? Speed, right? Each file that we upload in Firebase Hosting is cached on SSDs at CDN edges around the world. This means that no matter where your users are, the content is delivered fast. And last but not least, in Firebase Hosting, reverting a bad deployment is as hard as one click. In Firebase Hosting, you can also share resources across multiple sites. You can create custom domains, or you can even use reserved URLs. Firebase platform also offers other important services like Cloud Storage, which is used to store and share user-generated content like images, text, etc. Also, we have real-time database, which is used to store and sync data between users and devices in real time. Dynamic Links is another Firebase service which is used to deliver customized user experience. And last but not least, App Indexing is another service. We use the App Indexing when we want the users to re-engage with their installed apps.
In this section, I covered the core Firebase services, and started by going over Cloud Firestore, which is a cloud NoSQL document database, and it is really great because it offers flexibility. We can create expressive queries. It is great for syncing data. And, of course, it is scalable. And, next, I covered Cloud Functions, and we learned that Cloud Functions are secure and really fast. Then, next, I covered Authentication, and we said that Authentication as a Service is really easy and secure. And, of course, we can manage our users by resetting their password, by changing authentication type, etc. Hosting was another service that I went over. We learned that by using the hosting service, we can share resources across multiple sites. We can use custom domains and even use reserved URLs. So, this was all for this section. In the next section, I am going to cover Firebase SDKs, Frameworks, Helpers and Utilities.
Firebase SDKs, Frameworks, Helpers, and Utilities
Firebase is a really great platform which offers a lot of tools to make it easier for us as developers to create robust, secure and scalable apps. Google Firebase offers SDKs. It offers frameworks, helpers and utilities, and that is what I will be covering in this section. I am going to start with Firebase SDKs and cover the main Firebase frameworks. And at the end, I am going to cover Firebase helpers and utilities.
Before we learn about Firebase SDKs, let us learn what an SDK is. A Software Development Kit, or SDK, is a downloadable software package that contains the tools you need to build on a platform. Basically, it is a set of tools used for development in a given platform. Except for the Firebase SDKs, we have, for example, .NET SDKs, which are used to develop apps for .NET platforms, and so on. But, what can we find inside an SDK? Inside an SDK, we can find libraries or APIs. These are basically predefined pieces of code that help us as developers to perform common programming tasks on a platform. Then, next we have the Integrated Development Environment. These are basically the tools that we use to develop applications. So, for example, the XCode is Apple’s IDE for developing iOS applications. While there are many IDE options for Android as well. An SDK has other tools which help us to do things like debug, build, run, and test our applications. What about Firebase? Now Firebase SDK is the official SDK for Firebase. And Firebase SDK enables us to have access to different Firebase services. Firebase SDK supports different platforms like Android, iOS, Web, and it also supports other programming languages or platforms like Java, Python, Unity, C++, Node, or even Go language.
Working with Firebase SDKs
firebase-database library, which is used to access the Firebase realtime-database service. It also offers the
firebase-functions for the Firebase Functions service. It also has the
firebase-firestore for the Firebase Firestore service. And another one is the
firebase-storage library. This library is used to access the storage service in Firebase. It also offers other libraries like the
Other than Firebase SDKs, Firebase platform also supports different frameworks. Per definition, a framework is a library that provides a fundamental structure to support the development of apps for specific environments. The intention of designing application framework is to decrease the general issues that we face when we develop applications. And this is achieved by using code that can be shared across different modules of an application. But why would we want to use a framework? A framework serves as a wrapper, which means that it simplifies an interface to a technology, and it also helps us reduce the repetitive tasks. As a wrapper, a framework increases the app flexibility through abstraction. It also is an architecture because we use a framework to manage a collection of discrete objects. Other than that, it is a methodology because it makes sure that we use a consistent design approach. Now, since it is an architecture and a methodology, it basically means that it is a design pattern because design patterns are both architecture and methodologies. But which are the main frameworks that Firebase can work with? The first one is the AngularFire framework. By using the AngularFire, we can interact from our Angular application with our Firebase services. Another greate framework is the EmberFire, and the EmberFire framework is great for bindings for the Firebase Realtime Database and Authentication. Another one is the FlutterFire, which is a set of Flutter plugins that enable Flutter apps to use one or more Firebase services and it is used in Android and iOS.
Firebase Helpers and Utilities
Firebase as a platform offers different helpers and utilities that can be used to interact with the Firebase services. Some of the Firebase helpers are the FirebaseUI, the GeoFire, the FirebaseJobDispatcher, FirePad, and others like
firebase-util. But where do we use all these Firebase Helpers? Let us start with the first one. FirebaseUI is a helper which offers optimized UI components. The GeoFire, as the name already indicates, is used for location, but for realtime location queries. FirebaseJobDispatcher, as the name already indicates, is used to schedule background jobs. And the FirePad is a code and text editor. Other than Firebase Helpers, we have the Firebase Utilities. But which are the main ones and where do we use them? Firebase Tools is used as a Firebase command line tool. Then we have the Firebase Import, which helps import large JSON files into the Firebase Realtime Database. Then we have the Flashlight, which is an ElasticSearch integration with the Firebase Realtime Database. In conclusion, this section covered the main Firebase Helpers and the Firebase Utilities but, of course, you can learn more by going to their official documentation at https://firebase.google.com/.
Working with Firebase Helpers and Utilities
In this section we learnt about the Firebase SDKs, Firebase frameworks, and Firebase Helpers and Utilities. We started by going over Firebase SDKs. Then, next, we went over the Firebase frameworks where we talked about the AngularFire, the EmberFire, and the FlutterFire. We also talked about Firebase Helpers and Utilities. We talked about the FirebaseUI, the GeoFire, and Firepad. We also covered Utilities like Firebase Tools and Import and Flashlight.
Why and Why Not Firebase?
We covered a lot of great services that Firebase offers. But, of course, other than Firebase, there are a lot of services out there that offer similar services. In this section, I am going to cover why and why not use Firebase. I am going to start with the Why Use Firebase where I am going to talk about the key features that Firebase has to offer. The next, I am going to talk about Why Not Use Firebase. And then at the end I am going to talk about some features that we, as developers, have to decide based on the apps that we want to build. So let’s get started.
Why Use Firebase?
Why should we use Firebase? We have talked so far that using Firebase means that your apps will be performant. They will be secure and integratable with other Firebase services or even third-party apps using webhooks. Why else would we use Firebase? We said that Firebase offers Authentication as a Service where we can use the default features of Firebase service or we can even modify the UIs. Then next, Firebase offers a great file storage service. Also, database backups are really easy with Firebase. And other than that, Firebase is great when it comes to auto-scaling. Firebase also offers a great command line interface, which can be used to interact with different Firebase services. Last but not least, Firebase also offers a free tier, which means that before you decide to pay for Firebase, you can always test the Firebase services.
Why Else Use Firebase?
We know so far that Firebase is a platform, and as a platform, we know that Firebase is performant, it is secure and it is easily integratable with other platforms. But why else use Firebase? During this part, we are going to talk about the main pillars that make us, as developers, proud to use such a great platform. We are going to start with Analytics. Then next, we are going to talk about the Development. And at the end, we are going to talk about the third pillar, which is the Engagement. So let us start with the first one. By using Firebase, it means that we have unlimited reporting capabilities because Firebase offers a capacity to report 500 different event types. Other than that, by using the Firebase Console, we can segmentize our audience. And last but not least, we can use different Firebase or third-party services for different analytics. For example, we can use BigQuery, or we can use the Firebase Crash Reporting service or Firebase Notifications service. The next pillar is the Development. So by using Firebase, we can use amazing services like Cloud Messaging, which is used for communication. Other than that, Firebase offers the Authentication service, and we have covered this service so far. Another great service that comes from Firebase is the Firebase Hosting, which is used to host our apps. Next, we have the Remote Configuration. We have the Test Lab which can be used to test our apps before we deploy them to production. We have the Crash Reporting, which is a really great service that can be used to check how our app behaves. Other than that, we have the Realtime Database for realtime communication and the Firebase Storage for storing data. The last pillar and the third one is the user engagement. So by using different Firebase or third-party services, we can grow our user base, which means that we can increase the income. So we can use the AdWords. We can use App Indexing, Dynamic Links, and Notifications. And if you want to monetize your Firebase applications you can use the AdMob.
Why Not Use Firebase?