[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Locations\n=========\n\nWhen you provision a Firestore instance, you must choose a\n*location* for the instance. To reduce latency and increase availability, store\nyour data close to the users and services that need it.\n\nYou can optionally\n[create multiple databases](/firestore/docs/manage-databases) in your project,\neach with its own location setting.\n\n\nBe aware that once you provision a database instance, you cannot change its\nlocation setting.\n| **Important** : The location setting for your *default* Firestore database instance has a [dependency on the \"location of default Google Cloud resources\"](#default-cloud-location). This means that when you provision your default Firestore database, its location might have already been set, either during project creation or when setting up another service that shares this location dependency.\n|\n| Any non-default Firestore database\n| instances in your project do not share this location dependency.\n\nTypes of locations\n------------------\n\nYou can store your Firestore data in a\n[*multi-region* location](#location-mr) or a [*regional* location](#location-r).\n\n### Multi-region locations\n\nSelect a multi-region location to maximize the availability and\ndurability of your database.\n\nA multi-region location consists of a defined set of\n[regions](https://cloud.google.com/docs/geography-and-regions#regions_and_zones) where multiple replicas of the database\nare stored. Each replica is either a read-write replica which contains all of the\ndata in the database or a witness replica which does not maintain a full set of\ndata but participates in replication.\n\nBy replicating the data between multiple regions, data\ncan continue to be served even with the loss of an entire\nregion. Within a region, data is replicated across\n[zones](https://cloud.google.com/docs/geography-and-regions#regions_and_zones) so that data can continue to be served\nwithin that region even with the loss of a zone.\n\nFirestore supports the following multi-region locations:\n\n| **Note:** If your project already has an App Engine app with a location of either `us-central` or `europe-west`, then your *default* Firestore database will be considered [multi-regional](#location-mr).\n\n### Regional locations\n\nA regional location is a specific geographic place, such as South Carolina. Data\nin a regional location is replicated in multiple zones within a\n[region](https://cloud.google.com/docs/geography-and-regions#regional_resources). All regional locations are separated from other regional\nlocations by at least 100 miles.\n\nSelect a regional location for lower costs, for lower write latency if your\napplication is sensitive to latency, or for\n[co-location with other Google Cloud resources](https://cloud.google.com/about/locations/#products-available-by-region).\n\nFirestore supports the following regional resource locations:\n\nLocation SLA\n------------\n\nYour Firestore location type determines the\n[Service Level Agreement (SLA)](https://cloud.google.com/firestore/sla)\nuptime percentage:\n\nLocation pricing\n----------------\n\nYour Firestore location determines the cost of database\noperations.\n\nFor a comprehensive explanation of pricing per region and per region type,\nsee [Understand Firestore billing](/firestore/pricing).\n\nView the location of your databases\n-----------------------------------\n\nUse one of the following methods to view the location setting for your databases:\n\n- Run the [`gcloud firestore databases list`](/sdk/gcloud/reference/firestore/databases/list) command.\n\n- Open the\n [database list](https://console.cloud.google.com/firestore/databases) in the Google Cloud console.\n The location for each database is in the location column.\n\n- In the Firebase console, go to the\n [Firestore *Data* tab](https://console.firebase.google.com/project/_/firestore/databases/_/data)\n to view the list of your database instances and their locations.\n\nPossible location dependencies due to \"location for default Google Cloud resources\"\n-----------------------------------------------------------------------------------\n\nThe \"location for default Google Cloud resources\" is the location setting\nfor any project resources associated with Google App Engine, including the\nfollowing:\n\n- default Firestore database instance\n- default Cloud Storage for Firebase bucket with the name format of `*.appspot.com`\n- Google Cloud Scheduler used specifically with 1st gen scheduled functions\n\n| **Note:** None of the other resources in your project share this location dependency, including the following: Realtime Database instances, non-default Firestore instances, non-default Cloud Storage buckets, default Cloud Storage buckets with the name format of `*.firebasestorage.app`, non-scheduled functions, and 2nd gen scheduled functions.\n\nThis \"location for default Google Cloud resources\" is an immutable\nsetting. Also, when you set the location for one of the associated resources,\nyou indirectly set the location for all of them due to their common association\nwith App Engine.\n\nHowever, with many changes to the Firebase and Google Cloud ecosystem over\nthe years, the associations of resources to App Engine have been\nchanging. Most notably, starting\nOctober 30, 2024, all newly provisioned\ndefault Cloud Storage for Firebase buckets have the name format\n`*.firebasestorage.app`, and they are *not* associated\nwith App Engine.\n| **Key Point:** Starting October 30, 2024, provisioning the default Cloud Storage for Firebase bucket does not set the \"location for default Google Cloud resources\" (like the location for the project's default Firestore instance). Also, provisioning the default Firestore instance no longer sets the location for a new default Cloud Storage for Firebase bucket (with name format of `*.firebasestorage.app`).\n\nHere are the details of what changed in the possible **location dependencies**:\n\n- Starting October 30, 2024, **if the\n default Firestore instance and the\n default Cloud Storage for Firebase bucket are *not* yet provisioned:**\n\n - Provisioning the default Firestore instance sets the location\n for any future App Engine app provisioned in the project.\n However, it does *not* dictate the location of the future\n default Cloud Storage bucket.\n\n - Provisioning the default Cloud Storage bucket *no longer* provisions\n an App Engine app. Thus, the location of the\n default Cloud Storage bucket does *not* dictate the location of the\n future default Firestore instance.\n\n- Starting October 30, 2024, **if the default\n Firestore instance has *already* been provisioned, but the\n default Cloud Storage for Firebase bucket has *not* been provisioned:**\n\n - The existing default Firestore instance does *not* dictate the location of the future default Cloud Storage bucket (`*.firebasestorage.app`).\n- Starting October 30, 2024, **if the\n default Cloud Storage for Firebase bucket has *already* been\n provisioned** (specifically, the\n `*.appspot.com` bucket)**, but the\n default Firestore instance has *not* been provisioned:**\n\n - Back when the default Cloud Storage bucket (`*.appspot.com`) was provisioned, an App Engine app was *also* provisioned, and thus the location of the future default Firestore instance was set at that time. Even if you delete the `*.appspot.com` bucket, you can't delete the App Engine app, so the location setting of the future default Firestore instance is already set.\n\nIf you used ***1st gen scheduled* functions** , then their location is set to the\nlocation for default Google Cloud resources. This is because\nCloud Scheduler and App Engine previously had an association with\neach other. Also, if you set up 1st gen scheduled functions *before*\nprovisioning other resources that shared this location setting, then you set\ntheir location, too.\n\nNote that if you have an App Engine app with a\nlocation of either `us-central` or `europe-west`, then your\nlocation for default Google Cloud resources is considered\n[multi-regional](/firestore/docs/locations#location-mr).\n\n\nNext steps\n----------\n\n- To create a Firestore database in specific location, visit one of the [Firestore quickstarts](/firestore/docs/quickstarts).\n\n\u003c!-- --\u003e\n\n- For more information about building applications to meet your latency, availability, and durability requirements, refer to [Geography and Regions](https://cloud.google.com/docs/geography-and-regions#multi-regional_resources)."]]