Best Practices for Managing Tenant Data in a Multi-Tenant Application #4890
Replies: 3 comments
-
@JordanAtSatori can you please explain what you mean by "handling tenant data"... are you referring specifically to accessing the data in the Tenant table in the database and the associated connection strings in appsettings.json, or are you referring to accessing data from any table within an Oqtane database? In general, developers should not need to access the tenant or connection string information ie. the idea behind multi-tenancy is that these details are abstracted. Some comments on the code you included above:
|
Beta Was this translation helpful? Give feedback.
-
Instead of logging into each individual tenant to manage tenant-specific options, we want to centralize the management of these configurations within a master tenant. For example, each tenant has settings stored in their tenant-specific database that define which API endpoints they can access. Managing these settings from a centralized master tenant allows us to make changes more efficiently, without the overhead of logging into each tenant separately. Am I understanding correctly that the SystemInfo API you mentioned would be suitable for accessing and managing these settings across tenant databases from the master tenant? |
Beta Was this translation helpful? Give feedback.
-
@JordanAtSatori apologies for the delay in responding. The Setting API in Oqtane has the ability to store configuration for various entities. It sounds like you want to be able to store configuration data for each Tenant. You could use the Setting API for this purpose: Task<Dictionary<string, string>> GetTenantSettingsAsync() You might find this explanation of data scoping useful as well: https://www.oqtane.org/blog/!/72/data-scoping |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I'm working on a multi-tenant application and am currently handling tenant data from within a master tenant. Below is a simplified example of my current approach using dependency injection to retrieve tenant-specific configurations.
I'm wondering if there's a standard or best-practice way to manage tenant data in scenarios like this. Specifically, is there a more efficient or secure approach to handle database connection strings?
Beta Was this translation helpful? Give feedback.
All reactions