I am setting a new Firebase Firestore cloud for my project. I am from India and requires South-Asia1 for location But this location is having problem like cloud functions not enabled.
What should I do now, Should I go with my SouthAsia1 or change to nearest CloudFunctions location.
What does it mean that Deploying a function to this location is not yet available.
I am using firebase on Android with flutter.
Can I have cloud Function location and Firestore location different?
If you require those functions, I'd recommend picking the closest location that offers them.
In short, the further away the location, the higher the potential latency.
Related
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.
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.
Will different firestore and functions+hosting increase billing costs+latency compared they would be on same location?
I have a Firebase project where I use Firestore, functions and hosting. Default GCP resource location and Firestore location is eur3 (europe-west). Main usage of app is aimed to europe
I noticed after setting this location that docs state:
If you are using HTTP functions to serve dynamic content for Firebase Hosting, you must use us-central1.
And:
Firebase Hosting supports Cloud Functions in us-central1 only.
Would it be more optimal to have all locations on us-central1 even thought apps main usage/target audience is in europe?
It would not be optimal to have all locations on us-central1 as the latency is definitely going to be higher than hosting on the same region, although how much higher, that would highly depend on your use case. The cost will also be different, but probably not by much. Here's the GCP Calculator in case it helps.
Ideally you would have your hosting and functions in the same region. More importantly for latency when using functions but also cost.
You will pay for ingress and egress traffic when calling a function if the function is in a different region than your hosting.
Firebase does allow you to host functions in multiple locations.
https://firebase.google.com/docs/functions/locations
for my firestore database, I can clearly see the location of my database, like in this image
but I can't find out the default location of my firebase storage to store my images. I only find the bucket name
how to find the default region location of my firebase storage ? I need to ensure the location is the nearest from my user
is it always be the same as Default GCP resource location ?
The region of a project's default storage bucket is the same as Firestore. You actually agreed to set it that way in a dialog at some point during project setup. Please read the documentation:
Cloud Firestore and Cloud Storage — If you start using either of these products, you're prompted to select your project's default Google Cloud Platform (GCP) resource location (if it wasn't already selected when setting up another service).
most of my users will be in Indonesia. I am using Firestore, Cloud Function and Firebase storage in my project. currently I am in development phase and all my data is temporarily stored in us-central 1.
when fetching data from firestore or when I trigger the cloud function, the speed of operation is still acceptable around 1-3s (my data in us-central 1 and I am in Indonesia).
but when fetching image data from Firebase storage, it feels so slow due to high latency. so that is why I want to recreate my project and choose the region as near as possible from Indonesia
but if I see from the table in here: https://cloud.google.com/about/locations#asia-pacific
the nearest cloud storage for firebase from Indonesia is in Singapore, but unfortunately firestore and cloud functions are not available yet in Singapore,
the nearest firestore and cloud function available region from Indonesia are in Hongkong.
so my questions are
how to set my firestore and cloud function in Hongkong but my Firebase Storage is Singapore ?
If I can set in two different regions like that, is there any additional cost for this ?
How to set my Firestore and Cloud Function in Hongkong but my Firebase Storage is Singapore ?
As explained in the documentation:
Before you use Cloud Firestore, you must choose a location for your
database... This location setting is
your project's default Google Cloud Platform (GCP) resource location.
At the time of writing, this Cloud Firestore location is an immutable choices, i.e. it is not changeable (Creating a new project is the only way to change it).
For Cloud Storage, "your default GCP resource location is used for GCP services in your project that require a location setting, specifically, your default Cloud Storage bucket". However, with Cloud Storage, you have the possibility to create new buckets in other locations, if you are under the Blaze pricing plan.
You already got an answer, here, on how to reference to a specific bucket :-)
For Cloud Functions, you should refer to this documentation. You will read that "by default, functions run in the us-central1 region" but that it's quite easy to change the location of a Cloud Function by setting the region parameter in the function definition.
If I can set in two different regions like that, is there any additional cost for this?
Yes, you will have extra cost if your Cloud Function (which is in asia-east2 i.e. Hong Kong) interacts with your Cloud Storage (e.g. creates a file in Storage) which is in asia-southeast1, i.e. Singapore. More details in the documentation, here and here.