Coalesce
Coalesce copied to clipboard
Add mechanism to support multi-tenancy 'automatically'
Adding multi-tenancy (single database) to an application is a complex process that requires changes at nearly every level of the application. By baking this into Coalesce we could have the framework handle this for us.
Potential solution: Add a Tenant class and a TenantId to classes that need to be segmented by tenant. Create an interface and base class for multi-tenant classes in an application. Bake this into a provider model that would allow switching from tenant to tenant. (in a sample project) Create a Super Admin role for managing tenancy?
There is a great use case for multi-tenancy even when it isn't technically needed in that it gives a great way of testing in production (feature flags per tenant) without jeopardizing production.
This is now totally doable with the new data sources and behaviors infrastructure. However, it may be practical to write up a page in the docs that explains this scenario in specific detail - leaving this issue open for now to track work on such a page.