DEV Community

Cover image for A Quick Dive Into Firebae (Firebase)
Pato for This Dot

Posted on • Edited on

A Quick Dive Into Firebae (Firebase)

Firebase?

More like FireBAE.

I ❤️ Firebase! (Just in case it wasn't clear.)

What is Firebase?

A lot of you have heard of Firebase. Firebase is not just a database; it is way more than that!

Firebase is a web and mobile development platform. It has 18 products and is used by more than 1.5 million apps 😮. Also, it is backed by our friends at Google.

How can Firebase help me?

  • By building better apps
  • By improving the quality of your apps
  • By growing your business

Is Firebase expensive?

I don't think it's terribly expensive considering all is has to offer. I've built small apps using Firebase and will either use the Spark Plan, which is free, or pay as I go. Often times, it's just a few dollars.

I'm sure that as the app size increases, so will the cost, but Firebase offers three plans:

  • Spark Plan (Free)
  • Flame Plan ($25 a month) (Not applicable anymore)
  • Blaze Plan (Pay as you go)

For more information on pricing visit:
https://firebase.google.com/pricing

Firebase products

  • Build your app
  • Improve app quality
  • Grow your business

Build your app

Realtime Database

This is one of my favorite products from Firebase and it is the reason I started using it. Thanks to the real time database, I no longer have to write some of my apps using a server and sockets. Instead, I am able to write CRUD operations directly into the realtime database. One cool thing is that the data is hosted in the cloud so there is no need to set up anything on your computer.

One of the coolest features about the realtime database is that you can use it via REST API if you want.

Features:

  • Realtime
  • Offline support for mobile and web
  • Accessible from your mobile or web applications
  • The database is easily scalable

Firestore

It's another realtime database but on steroids. This database is a NoSQL database and you will feel more familiar with this database if you come from a MongoDB background. What I like about Firestore is that not only is it easy to structure my data, it can perform more complex queries than FireBase, the realtime database.

Firestore database functions with data models by storing your data in documents. Those documents are stored inside of collections. Before Firestore, we only had Firebase (Realtime database). That's when I wasn't sure if Firebase was ready for big applications but with Firestore, I changed my mind. You can now use this DB for a bigger application.

Features:

  • Flexible
  • Realtime
  • Offline support for mobile and web
  • Complex Querying
  • Accessible from your mobile or web applications
  • The database is easily scalable

Cloud Storage

Have you worked with Amazon S3 to store your content like images and videos? Well, Firebase offers a similar product called Cloud Storage. Cloud storage is relatively inexpensive so I would recommend you give it a try.

Features:

  • Robust Operations
  • Strong security
  • High Scalability

Authentication

Stop worrying about authentication security in your app. Let Firebase handle this for you. All you have to do is use their SDK and their UI library to allow authentication in your app.

Firebase authentication supports different types of authentication like email or social media.

Features:

  • Firebase UI Auth
  • Firebase SDK Authentication

Hosting

OMG! I love the hosting from Firebase. It's fairly simple! You can easily deploy your app via the command line and it is super fast! Forget about paying for other hosting services that are comparably overpriced.

Features:

  • Serve content over a secure connection
  • Host static and dynamic content plus microservices
  • Deliver content fast (they are not lying)
  • Deploy new version with one command
  • Rollback with one click

Cloud Functions

No server?

No problem.

You can host your backend code in the Cloud functions. The backend code runs when an event happens in your Firebase app or on an HTTP request. For example, you can setup sendgrid every time a new record gets added to the database to send an email to the users. If you are familiar with AWS Lambdas then Cloud Functions in Firebase won't be hard to try.

Features:

  • Zero maintenance
  • Integrates with other Firebase products
  • Keeps your code private and secure

ML Kit

ML?

What?

Yep, that's right. One of the products from Firebase is the Machine Learning kit. And the best part? You don't need to be an expert on ML to play with it. Unfortunately, this is only for iOS and Android, not Web...yet.

Features:

  • Deploy custom models
  • ML on device
  • ML in the cloud

App Quality

Firebase Crashlytics

This feature is super cool. I wish it were available for the web as well. Basically, this allows you to create crash analytics by giving you real-time notifications when something has broken as well as information about how many users are being impacted by this. This product will help you find the issues and will fix them faster.

Features:

  • Realtime alerts
  • Cures for the common crash
  • Integrated with Analytics
  • Curated crash reports

App Distribution

To make an app successful, you will need to test in more than one device and with more than one user.

Guess what?

Firebase can help you achieve this in a faster way with their App Distribution product. This product simplifies the process of distributing your app to test. You can integrate it with the Crashlytics product. Imagine the potential of these two together!

Features:

  • Cross-platform
  • Fast Distribution
  • Fits into your workflow
  • Tester management

Performance Monitoring

Thanks to this product, you can see the performance of your app. By using the product, you see the areas for improvement in your code. This product can help you avoid crashes by improving your code quality.

Features:

  • Customize monitoring for your app
  • Automatically measure app startup time, HTTP/S network requests, and more
  • Gain insight into situations where app performance could be improved

Firebase Test Lab

How many times has the app worked on your device, but not in another device?

Probably quite often! Especially with differences in responsiveness, different OS, different browsers, etc.

The Test Lab product can help you test your app in multiple devices and configurations. The results will be logged into your Firebase console. You can see how this can help you save time, money, and avoid bugs.

Features:

  • Test Android and iOS apps
  • Run on real devices
  • Workflow integration

Grow your business

Google Analytics

Have you ever heard of the awesome product Google Analytics for Web?

Well, guess what!

You can use it in your mobile apps and Unity apps as well. Cool, right?

This tool will provide you with analytics based on the usage of your app as well as user engagement.

Features:

  • Unlimited Reporting (for 500 different events)
  • Audience Segmentation

Predictions

This awesome tool uses Machine Learning to make predictions about your app and customize the experience of your app's users. The machine learning part uses your Google Analytics data so they work hand-in-hand. This product can also predict how the user will use your app or even if they are going to stop using it. This can help you keep your customer engaged!

Features:

  • Bring the power of Google's machine learning to your data
  • Boost conversions through customized user experiences
  • Increase retention with smarter notifications
  • Create custom predictions
  • Big query friendly

A/B Testing

Okay Google! Take my money! This product is awesome!

A/B Testing allows you to run tests in your apps. For example, you can run tests for UI changes, engagement campaigns, and new features. See the potential of this? You can see what people are responding to. This will help you increase the experience of an app which will lead to customer retention and more $$$.

Features:

  • Test and improve your product experience
  • Find ways to re-engage your users by using the notifications composer
  • Safely roll out new features
  • Target "predicted" user groups

Cloud Messaging

Have you ever wanted to send messages or notifications to your customers? "Hey, new version available. Download now!" Well, you can do so with this product. That's not all! It's also FREE.

Features:

  • Send notification messages or data messages
  • Versatile message targeting
  • Send messages from client apps

Remote Config

Ever wondered why Instagram looks a certain way today and then tomorrow, out of nowhere, it looks different even through you never downloaded a new version? Well, this product can help achieve this. You can update the UI or the behavior of your app without having to publish the changes and without having the customer download a new version.

Features:

  • Quickly roll out changes to your app's user base
  • Customize your app for segments of your user base
  • Run A/B tests to improve your app

Dynamic Links

Increase the user experience of your app with this product. This product is very cool for multiplatform apps. For example, if you want to redirect a user to a mobile link inside the iPhone app, you can do this. But if that person is using the web version of the app, you can make sure the link is the one for the web. In a nutshell, the links can be dynamic based on the platform they are using.

Features:

  • Set up Firebase and the Dynamic Links SDK
  • Create Dynamic Links
  • Handle Dynamic Links in your app
  • View analytics data

App Indexing

App Indexing is an awesome tool that will help you put your app into a Google Search. This tool also helps users go directly to Google search based on the content for which they are searching. With App Indexing, you can allow users to click on the button that appears on the home page of the Google results to install the app directly into their device.

Features:

  • Search results
  • Installs
  • Autocompletions
  • Assistant
  • Ad targeting

Invites

Want to get more people to install your app? Well, Firebase Invites can help you with this. Many of the users who installed it did so because they heard of it through a friend. With this product, you can prompt more people to install your app by allowing existing users to become referrals. This can be done by SMS or email.

Features:

  • Rich sharing that's easy for users
  • Rich sharing that's easy to implement
  • Invitations that survive the installation process

Conclusion:

After reading and learning more about Firebase, I can see how I can improve the workflow and the experience of my app. By making a better app, your number of users will increase and with more users comes increased profit.

All the products I talked about exist under one suite and are made to work with each other.

This Dot Inc. is a consulting company which contains two branches: the media stream and labs stream. This Dot Media is the portion responsible for keeping developers up to date with advancements in the web platform. In order to inform authors of new releases or changes made to frameworks/libraries, events are hosted and videos, articles, & podcasts are published. Meanwhile, This Dot Labs provides teams with web platform expertise using methods such as mentoring and training.

Top comments (13)

Collapse
 
dbredvick profile image
drew.tech

I'm using Firebase right now on quickerquestions.com, but I've run into many problems. Have you had any success implementing a complex security policy for Firestore that does authorization well?

Collapse
 
dbanisimov profile image
Denis Anisimov

Basically you have two options to implement complex authorizations while staying within Firebase serverless realm:

1) Use callable/HTTPS Cloud Functions to write data to your database and do all checks there + forbid any client writes using Security Rules
2) Optimistically allow client writes with minimal checks using Security Rules + validate and correct data using background triggered Cloud Functions.

There is a good post about these patterns: Patterns for security with Firebase: combine rules with Cloud Functions for more flexibility

Collapse
 
seanmclem profile image
Seanmclem

Yes, when pairing with another nodejs

dev.to/emeka/securing-your-express...

Collapse
 
dbredvick profile image
drew.tech

Thanks! I'm building with node right now so this is perfect.

Thread Thread
 
seanmclem profile image
Seanmclem

Yeah I'm in the middle of building an implementation based off this article. It's really working out

Collapse
 
saadnoorsalehin profile image
saadnoor salehin

Firebase is a bottleneck when it comes to complex queries. Full-text search isn't possible in Firestore. I think it is better for prototyping, but for a scalable production app, it needs to become more mature.

Collapse
 
devpato profile image
Pato

You definitely have a point, you can incorporate full text search using a third party product like algolia + firestore

Collapse
 
andrekelvin profile image
AndreKelvin

I'm currently using firebase MLKit for my text Detector app which is extremely easy to implement.

Collapse
 
iaboelsuod profile image
Ibrahim Zahema

More people need to get on board with Firebase!

Collapse
 
oleksandr profile image
Oleksandr

At last, I found clear explanations of Firebase, thanks!
But still not clear Firebase vs Firestore diff

Collapse
 
devpato profile image
Pato

I'm on my phone rn but I'll get back to you tomorrow. I just saw this idk why lol my bad

Collapse
 
rubensdemelo profile image
rubensdemelo

"As of January 2020, the Flame billing plan ($25/mo of additional quota) is no longer available for new sign-ups."

firebase.google.com/support/faq#fl...

Collapse
 
devpato profile image
Pato

Correct, that's why I mentioned in the article "Flame Plan ($25 a month) (Not applicable anymore)" it was a good option for playing around :(