GoogleCloudPlatform / spring-cloud-gcp

New home for Spring Cloud GCP development starting with version 2.0.
Apache License 2.0
418 stars 311 forks source link

Add support for specifying Firestore/Datastore DBs #2145

Closed TazBruce closed 1 year ago

TazBruce commented 1 year ago

Is your feature request related to a problem? Please describe. It is currently quite difficult to contain a Firestore/Datastore database to a single microservice. Currently the only solution is to use the (default) database and ensure microservices do not use the same collection names.

Describe the solution you'd like GCP has recently added support for multiple databases, meaning it's now possible to assign one per microservice. This could possibly be implemented by creating an optional system property such as spring.cloud.gcp.firestore.database = "xyz"

Describe alternatives you've considered This could also possibly be implemented by adding the field to a Document annotation such as @Document(collectionName="users", databaseName="xyz")

Thanks!

suztomo commented 1 year ago

contain a Firestore/Datastore database to a single microservice

Memo: This "contain" means "limit". This is a request to limit a (micro)service to use only a certain "database" (Pre-GA Offerings) https://cloud.google.com/firestore/docs/manage-databases#create_a_database.

MarcinLachowicz commented 1 year ago

I'm looking for the same mechanism too :)

MarcinLachowicz commented 1 year ago

Created a PR for Datastore: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/2150