Where are the Firebase server locations? - firebase

I am afraid of some latency when calling Firebase API. So I would like to know where the Firebase API servers are located. Are there any documents? Please help. Thanks.

The official documentation regarding choosing locations for your project, doesn't include an option for the Firebase Authentication. So currently, there is no way to specify a particular location for storing the Firebase Authentication data.
However, when you are using Cloud Firestore, Cloud Storage, or Cloud Functions for Firebase, you're prompted to select your project's default location. On the other hand, when using the Realtime Database, you're prompted to select the location of the instance, and each instance can be in a different location.
If you are also using Analytics, you're also prompted to select an Analytics reporting location. You can select a country or region that represents the location of your organization.

Related

How to add my project to multiple GCP resource locations?

I have built a firebase project which has "asia-south1" as its default GCP location, I choose this location because other servers had too much latency. But now I want the application to work in other countries as well, The data of one GCP location will also be accessed by others if we have multiple firebase projects and now I have really no idea how to proceed, your help would be really appreciated.
Hope I was able to clear the question
Thank you
Your Cloud Firestore data can be kept in either a regional or a multi-regional location. The developer must choose a location when Firestore is enabled in a project.
The only way for a developer to alter the location of data in an existing project is to start a new Firestore project at the desired location and transfer the data using the Import/Export capability. A Firestore project's location is not currently possible to be changed.
This is the public documentation on Firestore locations.
Just to clarify and complete my current response a little more, the only way to migrate your data (move your data) to another project at this time is manually using the managed export feature, as stated in this official document, or using cloud functions to schedule exports, as stated in this other one document, and then importing the data into your destination project.
It is unfortunately impossible to change the location of Firestore resource locations after setting up Functions, RTDB or Firestore. As per The Docs, Warning: Setting the location for one of these services (that is, Cloud Firestore, Cloud Storage, or scheduled functions) also sets the location for the others. After you set your project's default GCP resource location, you cannot change it.

How to get the location/region of an Datastore instance

To call the Datastore.export() API I need to provide a GCS bucket name in the same region as the Datastore I'm exporting.
I checked with node.js' #google-cloud/datastore Datastore instances seem to have no .location property or something similar. Also, the Google provided Datastore libraries in other languages seem to lack this functionality.
With other Google APIs you usually have a way to get the Location of the resource. E.g. in GCS: Storage().bucket('mybucket').getMetadata().location -> 'EU'.
How to view Google Cloud Datastore Region shows to get this information in a manual way, but I'm after programmatic access.
Firestore has a database get method (in preview as of 2021-12-23), that you can use to lookup the location of your database. This API will also tell you the mode of your database (Firestore native vs Datastore mode).

How to get Firebase automatically collected user properties?

I am hosting my web app on firebase and its clear that firebase knows where app is being browsed from, as i can see location data in firebase analytics. Fire-base automatically collects some user properties like country. Is there any method i can get this property value (country code or name) so i can curate app content accordingly?
I have found this line in firebase docs.
Analytics derives location data from users' IP addresses.
As google firebase doesn't disclose users IP addresses to developers. So its firebase duty to tell the users country to devs.
Google Analytics for Firebase derives information from the reported properties. This derived information is only available in the Firebase console (in the Analytics panel, and in other panels that build audiences based on analytics data).
There is no way to access the derived information in your own code, or to get it in the data exported to BigQuery. If you need similar information you will need to derive it yourself.
Also see:
How can I retrieve Firebase user properties?

I just deleted my app from firebase console , but it is still working and changing data in the realtime database

I just deleted my flutter app from firebase console , but it is still working and changing data in the realtime database.
Can anyone tell me how its still connected with the firebase?
Thanks
According to Firebase documentation, when you delete an app:
Corresponding API keys or OAuth clients are NOT deleted. You can clean
up the API keys or OAuth clients in the Google APIs console
credentials page. Deleting these resources will break installed
applications: your users will no longer be able to authenticate or
sign in.
Access to the realtime database is not limited to apps that are registered in the Firebase console. Any code that has the proper configuration for your database, can try to access that database. If you want to be more selective in who can access the database, you will need to do this with Firebase's server-side security rules, typically in combination with Firebase Authentication.

Can Firebase Database be set up to host data for 3rd party client? (e.g., analytics service)

Is it possible to set up Firebase to allow Auth/DB access into a common/shared database instance - where that instance is setup to be a centralized storage location for some 3rd party service?
For example, let's say there's an analytics service called StackOverflowAnalytics.com .. and so anyone who signs up for that service, can add tracking to their app with some secret user key. And then all the tracking for that Key is pushed to the same Firebase DB instance. And then the user can login via Firebase auth and the rules will restrict that they can only access the node for their Key.
I'm working on a 3rd party analytics client for Android - along the lines https://mint.splunk.com - where I would like to provide users a small Java/Android library they can add to their Android project, and this will help them track different data points while their app is running. The data is made accessible by saving it to the cloud from the device.
I am currently using Firebase, but it seems in order for the Firebase Auth & DB of a given Firebase instance to be accessible - the "specific app signing key" (package name/etc combo) needs to be set in the console for that Firebase instance.
It seems sharing across across unknown apps is not possible on Firebase. And that if I want to support something like that with Firebase (and not have to go to another cloud storage option), then I need to set up some proxy REST client .. like in Java or PHP .. that can serve as a centralized access point to that Firebase instance. Just wanted to check with other folks first in case this has been encountered and perhaps there are best practices already established around this particular case. Thanks
Firebase client libraries are generally not meant to be repackaged for use in other libraries. They're meant to be used at the app level.
A unique SHA-1 key is required on Android for Authentication to work with a particular app identified by package name. This requirement will definitely become a problem for you if you want this to work with arbitrary apps, since you would have to manually enter one for each app that wants to integrate.
As far as I know it's not possible to do what you want without creating a proxy, as you mentioned. I assume that firebase has some app validation that make unfeasible to share the Auth/DB.
Maybe a solution for you is to make a proxy too to access data:
"It looks like in order to access Firebase Analytics data, you export it to BigQuery. This is working for me and is automated."

Resources