Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespaces for Multi tenancy in Cloud Firestore

How do we set a different database / namespace in Firestore? This would be helpful in building multi-tenancy SaaS products.

like image 925
Gubbi Avatar asked Oct 12 '17 04:10

Gubbi


People also ask

What is tenant namespace?

Namespaces are owned and managed by administrative entities called tenants. A tenant typically corresponds to an organization, such as a company or a division or department within a company. In addition to being owned by a tenant, each HCP namespace can have an owner that corresponds to an individual HCP user.

Is firebase multi-tenant?

To support multi-tenant authentication we will use Firebase Authentication + Google Cloud Platforms' Identity Platform, which will provide us with multi-tenant support. You will need to go to Identity Platform in Google Cloud Platform and enable it. Here you can create tenants and add users to a specific tenant.

What is multi-tenancy in Google cloud?

In cloud computing, multitenancy can also refer to shared hosting, in which server resources are divided among different customers. Multitenancy is the opposite of single tenancy, when a software instance or computer system has 1 end user or group of users.

What is a multi-tenant cluster?

What is multi-tenancy? A multi-tenant cluster is shared by multiple users and/or workloads which are referred to as "tenants". The operators of multi-tenant clusters must isolate tenants from each other to minimize the damage that a compromised or malicious tenant can do to the cluster and other tenants.


2 Answers

It's something being considered, but no firm plans yet.

The current method would require you to create separate projects. A collection name scheme might be possible, but you'll run into composite index limits for the project.

like image 85
Dan McGrath Avatar answered Oct 30 '22 17:10

Dan McGrath


Based on the recent announcements by google, it looks this will become a thing:

Cloud Firestore, currently available in beta, is the next generation of Cloud Datastore, and offers compatibility with the Datastore API and existing client libraries. With the newly introduced Datastore mode on Cloud Firestore, you don’t need to make any changes to your existing Datastore apps to take advantage of the added benefits of Cloud Firestore. After general availability of Cloud Firestore, we will transparently live-migrate your apps to the Cloud Firestore backend, and you’ll see better performance right away, for the same pricing you have now, with the added benefit of always being strongly consistent. It’ll be a simple, no-downtime upgrade. Read more here about Cloud Firestore.

like image 2
logan Avatar answered Oct 30 '22 17:10

logan