Several Firebase products require a location setting:
Google Analytics — If you enable Google Analytics in your Firebase project, you're prompted to select an Analytics reporting location. This location represents the country or region of your organization. Your Analytics location, in turn, sets the currency for revenue reporting.
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).
Cloud Functions for Firebase (scheduled functions only) — If you run scheduled functions, Cloud Scheduler requires a Google App Engine app; during its setup 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).
To learn more about location settings for non-scheduled functions, visit Cloud Functions Locations.
Default GCP resource location
Several services available for your app require a location setting, called your project's default Google Cloud Platform (GCP) resource location. This location is where your data is stored for GCP services that require a location setting.
The following products share the same default GCP resource location:
Cloud Firestore
Note that your default GCP resource location does not apply to Firebase Realtime Database.Cloud Storage
Note that your default GCP resource location only applies to your default Cloud Storage bucket. If you're on the Blaze plan, you can create multiple buckets, each with its own location.Google App Engine (GAE) app
If you set up an App Engine app, its location shares your default GCP resource location. Note that if you use Cloud Scheduler (for example, to run scheduled functions), you're required to have an App Engine app in your project.
Types of locations
Analytics — Select a country or region that represents the location of your organization.
Cloud Firestore and Cloud Storage — Select a multi-region location or a regional location.
Scheduled functions (for the required App Engine app) — Select a multi-region location or a regional location.
Note that if you already have an App Engine app with a location of either
us-central
or europe-west
, any GCP service that uses this location setting
will be considered multi-regional.
Multi-region locations
A multi-region location is a general geographical area, such as the United States. Data in a multi-region location is replicated in multiple regions. Within a region, data is replicated across zones.
Select a multi-region location to maximize the availability and durability of your database. Multi-region locations can withstand the loss of entire regions and maintain availability without losing data.
Firebase supports the following multi-region GCP resource locations:Multi-Region Name | Multi-Region Description | Constituent Regions |
---|---|---|
eur3 |
Europe | europe-west1 , europe-west4 |
nam5 |
United States | us-central1 , us-central2 (Oklahoma—private GCP region) |
Regional locations
A regional location is a specific geographic place, such as South Carolina. Data in a regional location is replicated in multiple zones within a region. All regional locations are separated from other regional locations by at least 100 miles.
Select a regional location for lower costs, for lower write latency if your application is sensitive to latency, or for co-location with other GCP resources.
Firebase supports the following regional GCP resource locations:Region Name | Region Description | |
---|---|---|
North America | ||
us-west2 | Los Angeles | |
northamerica-northeast1 | Montréal | |
us-east1 | South Carolina | |
us-east4 | Northern Virginia | |
South America | ||
southamerica-east1 | São Paulo | |
Europe | ||
europe-west2 | London | |
europe-west3 | Frankfurt | |
europe-west6 | Zürich | |
Asia | ||
asia-south1 | Mumbai | |
asia-east2 | Hong Kong | |
asia-northeast1 | Tokyo | |
asia-northeast2 | Osaka | |
Australia | ||
australia-southeast1 | Sydney |
Set your project's location settings
For most use-cases, you set your project's location settings in the Firebase console, either during project creation or in the console page for the product.
Analytics
If you enable Google Analytics in your Firebase project in the Firebase console, you're prompted to select an Analytics reporting location.
If you're a project Owner or Editor, you can edit the time zone and the currency for your Analytics reporting location; go to your Google Analytics settings, then scroll to the Reporting pane.
Cloud Firestore, Cloud Storage, and scheduled functions
Note that your default GCP resource location might have been previously set, either during project creation or when setting up another service that requires a location setting.
In the Firebase console, when you initially set up Cloud Firestore or Cloud Storage, you're prompted to select your project's default GCP resource location.
If you run scheduled functions, Cloud Scheduler requires a Google App Engine app; during its setup you're prompted to select your project's default GCP resource location.
You can programmatically set your default GCP resource location by calling the
defaultLocation.finalize
endpoint for your Firebase project.
View your project's location settings
For Analytics — In the Firebase console, go to your Google Analytics settings, then scroll to the Reporting pane.
For Cloud Firestore, Cloud Storage, and scheduled functions — In the Firebase console, go to your Project settings.
Next steps
To create a Cloud Firestore database in a specific location, visit Get started with Cloud Firestore.
To create a Cloud Storage bucket, visit the Get Started page for your platform.
To run scheduled functions with Cloud Functions for Firebase, visit the setup guide.
For more information about building applications to meet your latency, availability, and durability requirements, refer to Geography and Regions.