How do I access Cloud Firestore when created as a service within Cloud Platform? - firebase

I'm familiar with using Cloud Firestore when created through Firebase, but I've created a Cloud Firestore as a service within Cloud Platform and I can't figure out how to have a client access that database. I was expecting there would be someway to generate a GoogleService-Info.plist so that my iOS app can access Firestore.
How is Cloud Firestore different when created from GCP, and how can clients access it?

If you want to access Firestore from iOS, you will still have to go through the Firebase console to add your app to the project and generate that plist file.
What you probably don't realize is that a Firebase project is just like a GCP project. Every Firebase project IS a GCP project, just pre-configured with some services and APIs enabled. Read this blog for a full discussion. If you created your project via the Cloud console, you can just as easily access the very same project from the Firebase console.
Your Firstore instance is 100% the same, no matter how you access it. All the same data and scaling behavior that you expect from Firestore. The only differences lie in how Firebase client apps add special mobile functionality. Read this blog for a full discussion specific to Firestore.
Bottom line is that, for use with mobile apps, you should still use the Firebase console to set that up. You can use both console together at the same time. They show almost entirely the same data, but Firebase is simplified for mobile-centric use.

Related

Is it a must to use firebase when deploying a flutter app even though I am using firebase in my code?

I have a flutter app, I previously deployed, which I added firebase even though I didn't use their database. Now, I have another project that does not use firebase. My question is:
Is it a must to use firebase when deploying a flutter app even though I am using firebase in my code?
There is no (explicit or implicit) requirement to use Firebase for your Flutter app. And even when you use Firebase, you don't have to use all of its (18 or so) products.
You can use parts of Firebase that you like, and use alternative products that you prefer for other parts.
For example, it is quite common for (Flutter) web apps to use Firebase Authentication to sign users in, and then use one of the databases in Firebase (Firestore or Realtime Database) to store data, but then deploy the web app to a non-Firebase hosting provider.
It's also quite common for (Flutter) web apps to use Firebase Cloud Messaging to deliver push notifications and background data messages, but no other parts of Firebase.

How to enable Firebase Realtime Database in GCP?

I want to extend an existing GCP project with a Firebase Realtime Database.
According to the Firebase documentation,
all Firebase projects are internally hosted on GCP
it is possible to use Firebase features directly from a GCP project,
so I went to the Marketplace and found the corresponding product page there.
Unlike other product pages, this one doesn't have an "Enable" button on it but rather "Get started for free".
This button does nothing, no response at all. Any deas?
You can just go to the Firebase console and from there you will be able to use Firebase Realtime Database for the same project.
It is not possible to use all the features of Firebase directly on Google Cloud Platform, but you will find common products as Storage and Cloud Functions i.e. that are shared between Firebase and Cloud Platform

for a company interested to use only Firestore, what is the differrence between gcloud and Firebase CLI

My straight question is: since I am not interested in other Google Services, only Firestore, what is the difference between Firebase Cli and gcloud? Can I do all I need only with Firebase Cli or should I learn also gcloud?
I can easilly see that gcloud can handle more services than Firebase Cli. Also I can see Firebase Cli remenber me a lot the purpose of npm+ng cli when working with NodeJs/Angular (a simple analogy about scaffold/initialize/deploy). Nevertheless, our company will only use Firestore to take advantage of its Realtime Database pushing events to our mobile application.
I use Firebase Cli to type in my Windows command line and create a project in Firebase. I can see the result in Firebase Console and I also can see it in Console Cloud Plataform.
For me, who is total beginner with Google Cloud Plataform, it is a bit confused when prefer one over other. For instance, let's say I want to query data from Firebase Crashlytics from command line instead of logging from my Browser. Is it possible to use either Firebase Cli or gcloud? If both, which one is recommended for some company only interested in Firestore project?
This week I am struggling to figure out how to extract metrics regard my Firestore project and if I don't know what is the recommended tool for reach this task it make even harder to find the first steps. By extracting I don't mean see a beatifull dash in Google Console. I mean consume an endpoint providing me Firestore Metrics or, even better, subscribe my endpoint to Firestore project which will be called every time some issue happens (Other question asking exactly about getting Firestore metrics)
It is confusing and is partly the result of Google's acquisition of Firebase, the creation of what's now called Firestore (which is the unification of the original Firebase backend technology and Google Cloud Datastore), and that Google provides the Firestore service to both its Firebase and Google Cloud developer audiences.
As you've gathered, Google Cloud's CLI (Cloud SDK aka gcloud) and the Firebase CLI overlap in functionality. However, importantly:
both CLIs interact with a shared set of Google services (e.g. Firestore, identity, logging etc.).
there are some Google Cloud services not part of Firebase and vice versa
If you're focused on Firebase, you should be to able to stick with the Firebase CLI and continue to interact with Google's services through this Firebase lens.
If you include Google Cloud Platform services that aren't part of Firebase, you'll need to then consider using gcloud but importantly, you can either:
continue to use the Firebase CLI for the Firebase services;
use gcloud to interact with some (not all!) of the Firebase services (e.g. Firestore).
Over time, I assume (!) the remain discord between these 2 platforms will diminish.
If you consider both platforms as the result of (an ongoing?) unification since the acquisition, hopefully, these discrepancies will be more understandable and less frustrating.
Where you do find inconsistencies and frustrations, ensure Google knows by submitting feature requests and bugs.

2 different Firestore interfaces

I've got 2 different firestore interfaces: both using the same firestore project.
I'm finding this abit confusing - which one am I meant to operate in?
How come the 2nd doesn't have access to other settings such as Rules?
They are both meant for you to operate in. Which one you use depends on whatever your preference is. If you prefer to stay in the Firebase ecosystem, then use the Firebase console. If you prefer to stay in the Google Cloud ecosystem, then use the Cloud console.
Read more about the differences with Cloud Firestore between Firebase and Google Cloud.
Cloud Firestore is available with, or without Firebase SDKs.
For Firebase users, the Firebase interface allows you to configure Firebase specific functionality (Rules).
For GCP users, the Google Cloud interface keeps you closer to other services and admin settings you'll likely be using, such as IAM, BigQuery, etc. It also gives you quick access to a shell (Just click the Cloud Shell icon) so you can quickly run commands like gcloud firestore export.
Both interfaces will show you the same data.
Work in the first one. The second one is a simplified screen I think, because it is also for other services

Connect to Firebase buckets

I have a backend in golang and was wondering how I can connect to Firebase storage to create/delete buckets and add/delete files. Can I use the Admin sdk. I found the client storage lib in golang for google cloud storage. Can I use that? And whats the difference between firebase storage and google cloud storage?
The app I'm working on connects to Firebase Storage Buckets via the Admin SDK, but we're using Firebase Functions in Node.js. However, it looks like the Admin SDK in Go offers the same Storage access, and it's documented (with example code in Go) here:
https://firebase.google.com/docs/storage/admin/start
I like using Admin in Firebase, because you don't have to worry about project configuration and authentication to the various services. Firebase storage is google cloud storage, but with a nice wrapper and well-integrated into other aspects of your Firebase project. You get some limitations as a trade-off for all of that convenience, but unless you run into a feature of Google Cloud that you absolutely need and doesn't exist in Firebase, I'd stick with the Firebase (and Admin) version.

Resources