Top Firebase Products In A Nutshell

So it was a pretty interesting week with back to back Firebase discussion and hands-on events lined up for developers at Bangalore. First, it was the June meetup of GDG Bangalore who had invited Abhay Sood to discuss the new Architecture Components i.e Room, LiveData, etc and Harsha Ram to talk about Fabric. Next event was the most awaited #AppFestIN, the 4 city tour of the actual developers of Firebase who had come all the way down to India to exclusively talk about Firebase (OMG OMG THIS IS A SERIOUS DEVELOPER CRUSH MOMENT). And they conducted a hackathon in each city for us to work on some firebase-y apps. Super exciting!

So Mike McDonald, who leads the Firebase Storage team, gave a talk on all the features and tools of the Firebase platform before the hackathon began. And this post takes a lot of examples from his talk. A lot, I say.

Brief updates

  • Over 1 million developers are using Firebase, with India being the second largest market.
  • Firebase has been around since 2011, originally as a database and now growing to a full mobile platform.
  • Since Google IO 2016, there has been 40 major releases and 100 different updates to all the various components of firebase. Still building and iterating very rapidly due to feedback of developers who use it.
  • The most exciting announcement or the biggest update: 4 months ago, Firebase acquired Fabric.
  • Crashlytics, the largest mobile crash reporting in terms of number of developers and apps installed, also Fabric’s flagship service, will become the main crash reporting product for Firebase. So the engineers at Firebase have been working the past 4 months to integrate the best pieces of Fabric into the best pieces of Google and Firebase.

So enough of that, lets dive into the specific features of Firebase.

Realtime Database

When you are in your phone or your browser, and you make a change in the database, all of the other clients subscribed to listen to the changes will get reflected with the changes. So, when a change goes up, Firebase will push it down to all the other devices. And all of this happens in under 100–200ms. Real quick!

Firebase also takes care of Latency Compensation. If you’re building a chat app, regardless of your network speed, Firebase will always show you your messages.

So if you are messaging a friend, “Hey, wanna go somewhere?” and you are in the train and the network isn’t great, Firebase will still show you your messages, and queue them up, and you as an end user will have a seamless experience. When you are back online or back in good network connectivity, Firebase will sync all those messages in other devices. The great thing is that you, as a developer, don’t have to write a bunch of code to queue up all your network requests, or persist everything locally; Firebase does all that for you.

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

That’s all and Firebase will persist everything and make sure you have a great offline experience. People love this feature.

Firebase Authentication

So typically when you build an application, you have been integrating something like your own email password solutions. Here comes Firebase to the rescue.

Firebase Authentication is a serverless, single sign on experience, so you can sign in either with your email-password, social provider, or even login anonymously.

In the Bangalore event, somebody even suggested if Aadhar card verification can be done using Firebase and Mike was excited to hear about it. He further talked about custom Authentication. Now in this scenario, you can make your own token, so you can sign in with aadhar, bring it back to firebase, and let you use firebase token.

So 4 months back when Firebase acquired Digits, or when they acquired Fabric, they thought of taking all the things that Digits offered and built them into Firebase Authentication. Thus, Firebase now offers authentication with phone number sign in.

They also offer raw APIs. So if you have your own sign in flow, and you’re using some other SMS provider, you can easily swap in with theirs and keep your existing flows.

Plus, when you get an OTP SMS, they can simply read your OTP and drop it right where it’s required. No permissions needed.

Cloud Functions

(Released in Beta in IO) 
Imagine a device that writes to a database and that triggers a cloud function, which is basically little snippet in JS, that does something else, something like translating messages to different languages, thumbnailing photos or even reducing size to limit bandwidth.

Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. Your code is stored in Google’s cloud and runs in a managed environment. There’s no need to manage and scale your own servers.

Firebase Cloud Hosting

Firebase Hosting provides fast and secure static hosting for your web app. Firebase gives you CDN for free, SSL for free, hooks up your custom domain for free, literally the easiest way to get a website on the internet. So they are giving you a fast, secure and reliable way to host your app’s static assets such as HTML, CSS, JavaScript, and media files. However, with Cloud Functions, you can support dynamic generation of content for your Firebase Hosting site.

Cloud Storage

Now this is Mike’s favourite feature, because (no prizes for guessing), he built it.

It’s great for all the rich media content that you share in your app. The whole goal is to augment the capabilities of Realtime Database, with a literal petabyte file storage solution. Firebase Cloud Storage is also the same thing that’s powering apps like Spotify, for all of their music streaming, and also powers Google Storage. Developers use the Firebase SDKs for Cloud Storage to upload and download files directly from clients. If the network connection is poor, the client is able to retry the operation right where it left off, saving users time and bandwidth.

At IO, Firebase announced the ability to have multiple buckets in different locations. Google Cloud Platform (GCP) is expanding very rapidly, to a bunch of different data centers, we just launched Sydney.

Big News: It’s also coming to Mumbai, later this year, or earlier next year. So you can get your own cloud storage in Mumbai. When that happens, get cloud storage buckets in Mumbai, so store all your files right here in Mumbai. Should make your life easier, reducing latency, etc

So that was a brief run through of all the Firebase developer products.

Firebase Crash Reporting

The following product will prevent you from getting angry emails from your customers who keep complaining of app crashes because your app will no longer crash. Just insert one line, import firebase crash reporting, and Firebase will automatically get your crash reports and upload to Firebase. This feature is also integrated with analytics so you can see your app crashes from your analytics console.

However, Mike totally recommends the Crashlytics users to continue using their favorite platform. They are working in integrating it with Firebase console for really seamless experience.

Crashlytics is awesome, please keep using it. — Mike

TestLabs

Now, Crashlytics helps you after you have shipped, TestLabs could come in the play when you want to prevent your apps from crashing in the first place.
Testlabs lets you do all the automated tests on a number of physical devices (they literally have hundreds of virtual devices), even run Chaos Monkeys style tests where they try and break the app. You can even use Robo test to find issues with your app so you can test your app even if you haven’t written any app tests.

They also have some really cool new updates and some really good support for games. You can run on less CPU intensive devices, less memory intensive, or you can tweak network requests, say you want to test your app on LTE, 3G, or even 2G, simulate packet loss, poor networks and see how your app responds in such situations. Additionally, they have added a couple of devices, like Pixel and the latest android O (one of the perks of being in Google).

Performance Monitoring

Firebase will be give you all information about all your network calls for e.g latency, how the response went, etc. Mike talks about a discussion with one of their partners where they discovered a bug in the backend before the backend team knew there was a bug in the backend. Because they had instrumented their app with Firebase Performance Monitoring and received some 400 errors.

Performance Monitoring helps you to understand where and when the performance of your app can be improved so that you can use that information to fix performance issues.

Firebase also allows you to add custom traces. So, like if you say, I want to measure the time it takes to do X, so Firebase will do the work and will present you the information to you in a cool dashboard.

Google Analytics for Firebase

This one is the heart of growth products tying all products together. It tells you who is using your application, where your end users are, what devices they are using, what OSes they are on, are they spending money on your application, how many daily active users are there?

General Analytics Dashboard

Some of the interesting tools of Google Analytics are:

Streamview — launched just a couple of months back, StreamView visualizes events as they flow into Firebase Analytics, and gives you a general sense of how your users are interacting with your app. Events like users opening the app, signing in, users doing in-app purchases, StreamView can give you a sense of where in the world people are using your app, right down to the city level.
 Show image demo.

Debugview — With DebugView, you can immediately see which events are being reported to Firebase Analytics. This will be activated for any device for which you’ve turned on Analytics Debugging, and is great for making sure you’re logging the right events with the right parameters while you’re building your app.

Another interesting product— BigQuery, Google’s petabyte data warehouse. BigQuery can scan TB in seconds and PB in minutes.

Cloud Messaging

(or formerly GCM)

So a bunch of you must already be sending push notifications? FCM (or Firebase Cloud Messaging) is a cross-platform solution for messages and notifications for Android, iOS, and web applications, which currently can be used at no cost. You can send notification messages to drive user re-engagement and retention.

Firebase also lets you send notifications based on user properties and analytics. You can target messages to a particular audience, like to users who match a certain type of events. So imagine, you know the audience who are likely to purchase your app, so you can target this particular audience with a specific notification. Firebase can also tell if somebody uninstalled your app because you sent a crappy notification. :(

Remote Config

Server side config that you can have, like feature flagging or A/B Testing, or even extra special customized welcome messages, to people who have spent 10$ on your app!

Dynamic Links

So somebody sends you a coupon code, and the coupon says we both get 10% off if you install app, and this link drops you straight into the app, with that specific content, no pain of downloading app through PlayStore. It works across platforms even.

Google AdWords

This is the premier advertising solution on mobile. It offers a number of different formats of Ads such as Native Ads, TrueView In-stream Ad, Backdrop Ad, Dynamic Text Ad, etc. Plus you can get all that information in Firebase Analytics, so you can see if the ads are bringing users to your application or shooing them away.

AdMobs

AdMob is the premier monetization platform for mobile. If AdWords is half of the Ads equation then Admobs is the other half. AdMob by Google is a mobile advertising platform that you can use to generate revenue from your app. So you get paid to show relevant ads from over a million advertisers with AdMob.

App Indexing

Firebase App Indexing gets your app into Google Search. This is as simple as it can get. If users have your app installed, they can launch your app and go directly to the content they’re searching for. If users don’t yet have your app, relevant queries trigger an install card for your app in Search results.


Finally…

Firebase in a Weekend — A Udacity course which promises to teach you Firebase in 2 days using a series of videos, interactive documents, etc. So basically, it teaches you how to use Firebase features by actually building the applications. And it’s absolutely free of cost.

You can check the course details here.

Firebase Alpha Program — All the features that I mentioned here were tested by developers like you before Firebase shipped them. These alpha testers found some really awesome bugs, usecases that Firebase engineers never thought they would find. So if you want to get an early access of their products. You can register right here.

Open Source SDKs — This is by far one of the best announcements. Firebase is taking their first steps into open sourcing their client libraries. Great news here is the resultant visibility and transparency of the product. They don’t want Firebase to be a magical black box where everything simply just happens. As you dig deeper and stumble upon barriers, developers should be able to look at the source code, find bugs and eventually fix them. Explore the Github repositories here.


If you like what you read, make sure to ❤ it down below.

In the next series of posts, I am going to cover most of the Firebase products one by one in technical details by building few demo applications. Follow me on Medium or Twitter to stay updated.