What’s the relationship between Firebase and Google Cloud?

If you are a mobile application developer or a User,  I imagine that you know something about Firebase,Google's mobile application development platform,Google Search Console . Or, if you are an enterprise system developer, you know something about the Google Cloud Platform (GCP) Or Google cloud console, a comprehensive suite of products and services that captures your data and code, on a planetary scale, and more. Although both platforms can be used without the knowledge of the other, there are some ways in which they overlap. Knowledge of this relationship is important in two situations:
  • You are a firebase application developer, and you need to extend your backend infrastructure in addition to the firebase provider by default.
  • You are a Google Cloud Developer and you want to build a mobile (or web) application on top of GCP's existing resources.

Even if these situations (yet!) Do not apply to you, understanding how tools and services are related will help you to get some work done, especially with your Firebase application.
So, what do you need to know? Let's start with the most important details.

A Firebase project is also a GCP project

When you go to create an acount in Firebase Project, You see No need to know anything about GCP. The on-boarding path is optimized to arrive at a workable solution with minimal effort. I know that many developers appreciate it!
Here is a screenshot of the Firebase console after you create a new project:

You can see a scrollable list of products on the left side, so that the top-level categories expand and break down, in the middle, you have some buttons that help you get started adding the app to your app. It is pretty clear what to expect next. Later, after you add an app and start using some products, the main area changes to the dashboard that shows you some statistics on the products you use.

The look and feel are almost completely different. Here, I also opened the hamburger menu at the top left and it revolves around original content. This menu scrolls, too, and there are more products and options than you can see in the Firebase console.

You can think of a GCP project as a virtual container of data, code, configuration and services, regardless of how it was created. When you create a Firebase project, you're actually creating a Google Cloud project behind the scenes. This means you can view and manage many aspects of your Firebase project in the cloud console.

In some cases, the Firebase Console actually represents some common tasks, such as billing management and administrative user management (known as Identity and Access Management, or IAM in Cloud Console). So if you are working with Firebase Console, somehow click on something with a blue and white UI theme, you are barely transported to the Cloud Console. Same project, different console and UI. If you try to click on a billing account from the Firebase Console, see what it looks like. It's definitely a cloud console, though it says "firebase" at the top:

There is one very important thing to know about the holder of this project. Since the underlying project is the same for both Firebase and GCP, if you delete the project using Firebase or Cloud Console, you delete everything from that container, regardless of where it was configured or created. So, if you create a project with a cloud console, add a firebase to it, then delete the project in the firebase console, all your cloud data will be deleted as well.
      An existing GCP project can be configured to add Firebase services 
Instead now imagine that you have created a project in the cloud console. For starters, your project will have nothing directly related to configuring Firebase. Best of all, Cloud Console doesn't know if you're planning to build a mobile app, but why set it up? But if you have an existing cloud project, you can easily add a firebase to it.
To add a Firebase service to an existing project, go to the Firebase Console, click the "Add" button. When it asks for your project's name, you have the opportunity to choose an existing project from the dropdown that shows how to add a firebase to your existing project.
Here, you'll see a number of APIs (enabled by default), including some Firebase product APIs highlighted in the red box. This description of enabled APIs is hidden from the developers of the Firebase console, as it is not really necessary to know it. But as the application's backend becomes more sophisticated, the knowledge of GCP APIs and services gains importance. For example, an app developer might want to use the Cloud Vision API to extract text from images captured on a device camera. And then go ahead and translate the text discovered in that image using the Cloud Translation API. To use these APIs (and get billed for them) you need to enable them in the cloud console. Once enabled, you can call them from your backend code (for example deployed in cloud functions).
As you dig into each console, one thing you may notice is that the products you can manage in the Firebase Console consist of three item matches with the set of Cloud Console products. These products are Cloud Storage, Cloud Fire Store and Cloud Function. Each product is the same at its core, regardless of where you are looking, they are managed and managed very differently between the Firebase Console and the Cloud Console. This takes me to my next point.

       Firebase adds SDKs, tools, and configurations to some Google Cloud products 

As you can guess from their name, cloud storage, cloud fire store and cloud functions are Google cloud products. Technically, these are not Firebase products, though you can work with them in the Firebase Console and manage them in your application using the Firebase SDK and tools. First, some quick definitions:

  • Cloud Storage (Firebase, GCP) is a large-scale scalable file storage system.
  • Cloud Fire Store (Firebase, GCP) is a large-sized realtime NoSQL database.
  • Cloud functions (Firebase, GCP) provide serverless compute infrastructure for event driven programming.

Except for Firebase in Image, these cloud products are commonly used in enterprise environments, where data and processes are mostly controlled within the Google Cloud Storage or any other backend. To work with these products programmatically, the Google Cloud Command Line tools provide the client API meant for backend code, including gcloud and gsutil.

With Firebase in the picture, these three products provide additional SDKs for mobile clients, with Firebase CLI able to work seamlessly with mobile applications through additional tools and a way to configure security rules to control access to data through paid SDKs. I'll talk about some of the specifics of these firebase additions in future posts.

(Since I mentioned Cloud IAM earlier, I should also mention that Firebase gives additional IAM roles for some Firebase products that give other members of your team a granular access to those products, without the risk of causing any dangerous changes to your project elsewhere)

Note that the names of these three cloud products do not change from a firebase perspective. I know it's tempting (and natural!) To say things like "firebase storage" and "firebase functions", but these names aren't accurate. Am I being pedantic about this? Perhaps, but you won't find these names anywhere in the official documentation! But when working with Firebase add-ons for these cloud products, you'll see names like "Cloud Storage for Firebase" and "Cloud Function for Firebase".

OK, what’s the upshot of all this?

If you're a Firebase App Developer, you've probably created your project on the Firebase Console. However, at some point you may have to jump to the cloud console for some administrative tasks, expand your cloud infrastructure, or use the Cloud API. The Firebase Console is the start of your mobile app's infrastructure.

If you are a cloud infrastructure developer and you want to build a mobile or web application against the data you already have stored, you will need to go to the Firebase Console to address the unique configurations and functions for Firebase additions.

In fact, working on GCP projects, Google projects actions on these projects are enabled by default (if you're working in dialogflow), so this is another way you can end up with a fresh perspective on a GCP project. However, no matter how your project came into existence, the console you started with may not end up being the only console you use. Thinking of a project primarily as a container for services and APIs makes this transition much easier. Each console is just giving you a view of those services and APIs in a different way.

Read more about the difference between related Firebase and Google Cloud:
  • Cloud Function
  • Cloud Fire Store
  • Cloud storage
Finally, if you enjoy reading this please comment to ensure more of its kind.

Enjoy your day!!!


Post a Comment