'Multi tenant in Firestore
Looking to build a CRM type application and need to separate the data for each client in the firestore database.
Whats the best way to structure the data?
If we take a few basic collections for this example... company, user, account, product.
- A user is simply the user of the application i'm building.
- This
userwould work for acompanythat employs them. - The
userwould then look to sellproducts toaccounts.
Generally to handle this should I be placing
companyat the root level.- Then
user,accountandproductunderneathcompany.
Im unsure whats best security wise and/or normal convention.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
