This page describes how to configure the Firestore in Datastore mode client libraries to use a regional or multi-regional endpoint.
When you use Firestore in Datastore mode client libraries, you can use any of the following endpoints:
Global endpoint: By default, the Firestore in Datastore mode client libraries send API requests to a global service endpoint named
datastore.googleapis.com. The global service endpoint routes the request to your database. During routing, the request might pass through a server in a location that's different from your database location.Regional endpoint: A regional endpoint enforces restrictions ensuring that data is transmitted, stored and processed in a specified Google Cloud region. To ensure that the service endpoint processes your app's Firestore in Datastore mode requests in the same region as your database, specify a regional endpoint in the client library.
Multi-regional endpoint: A multi-regional endpoint enforces restrictions ensuring that data is transmitted, stored and processed in a specified Google Cloud multi-region. To ensure that the service endpoint processes your app's Firestore in Datastore mode requests in the same multi-region as your database, specify a multi-regional endpoint in the client library.
Set a regional or multi-regional endpoint
The method for configuring a regional or multi-regional endpoint is the same:
you provide the endpoint string when initializing the client library.
The following examples show how to set the endpoint string using a regional
endpoint (datastore.us-central1.rep.googleapis.com). To use a multi-regional
endpoint, provide a multi-regional endpoint string corresponding to your
database's location (for example, datastore.us.rep.googleapis.com for nam5).
Java
To learn how to install and use the client library for Datastore mode, see Datastore mode client libraries. For more information, see the Datastore mode Java API reference documentation.
To authenticate to Datastore mode, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Datastore mode, see Datastore mode client libraries. For more information, see the Datastore mode Python API reference documentation.
To authenticate to Datastore mode, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Regional and multi-regional endpoint semantics
Regional endpoints
Firestore in Datastore mode supports regional endpoints for the regional locations listed here Firestore in Datastore mode locations.
Use the following format to define regional endpoints:
Java
datastore.REGION_NAME.rep.googleapis.com:443
Make sure that the port number is defined along with the endpoint.
Python
datastore.REGION_NAME.rep.googleapis.com