BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Google Introduces Firestore Multiple Databases

Google Introduces Firestore Multiple Databases

This item in japanese

Google Cloud recently announced the general availability of Firestore Multiple Databases. The new feature is designed to isolate customer data and facilitate the management of microservices, as well as development, test, and staging environments.

Announced in preview in the summer of 2023, the new feature supports multiple regions and both Firestore database modes, Native Mode and Datastore Mode, in the same project. Furthermore, Firestore’s cloud monitoring metrics and stats are now aggregated at the database level.

While it is now possible to manage multiple Firestore databases within a single project, each document database operates with independent isolation, ensuring both data separation and performance: the cloud provider claims that traffic loads on one database will not adversely impact the performance of others within the project.

By leveraging the conditional Identity Access Management control, it is possible to specify different security policies on databases within a project. Sichen Liu, senior software engineer at Google, and Minh Nguyen, senior product manager lead at Google, explain:

Firestore lets you apply granular security configurations on an individual database through IAM conditions. This functionality allows distinct security policies to be applied to different databases, enabling precise, granular control. For instance, you can grant specific user groups access solely to designated databases, ensuring robust security and data isolation.

The new feature simplifies cost tracking too: Firestore now offers granular billing and usage breakdowns on a per-database basis. Developers can monitor costs using BigQuery, segmented by individual database IDs.

Supporting multiple databases has been a long-term request from the community. The challenge of creating different databases for production, staging, and development was highlighted several years ago, leading some developers to use the predecessor Firebase Realtime Database instead. Francisco Durdin Garcia, full-stack developer at PrivateGPT, asked in 2018:

It's possible to create multiple instances of Firestore Database (one for each project) inside the same console in Firebase? I saw that it's possible to do it for Firebase Realtime Database, but I don't see the possibility to do it for Firestore.

Azidin Shairi, cloud architect at Happeo, tested the new feature during the preview and wrote:

This eliminates the need to create multiple projects just for Firestore databases and if you have a small environment, this also reduces the complexity with cross-project access control.

Liu and Nguyen add:

Carefully choose database resource names and locations during creation, as these attributes cannot be altered post-creation. However, you can delete the existing database and subsequently create a new one with the same desired resource name, but in a different location.

With the GA, multiple databases are now supported in the console, Terraform resources, and all SDKs. If your application does not require multiple databases, Google suggests continuing to use the (default) database, as both the Cloud Firestore client libraries and the Google Cloud CLI connect to it by default.

About the Author

Rate this Article

Adoption
Style

BT