Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Common/General code lists in each tenant database #7523


User avatar
0
leonkosak created

For instance that one code list is common on application level. Tenant users cannot even change/add/delete values of this code list. Our policy is also that each tenant has to have separated database (and not inside host database). Such code list (SQL table) has IMAYHaveTenant in C# model.

Is something wrong, that Migrator creates code list values in each tenant database, because we want to limit number of SQL queries to host database. This is more important in public cloud environment (Azure,...) so that the costs of these queries are directly "forwarded" to tenant's database.

Can someone confirm that described concept is good or it's better to have such code lists just in host database anyway?

Thank you.


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @leonkosak

    Then only thing is, if code list changes on host side, you have to update all tenant databases if I understand your scenario :)

  • User Avatar
    0
    leonkosak created

    Yes, this is my scenario. So "multiplicationg" the same code list across all tenant databases is technically good solution? :) (This also means that such code list in host database is at least duplicated - for host and for Default tenant. If more tenants is in host database, then "multiplication factor" for such code list is even higher.)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Do you allow host users or tenant users to modify initial code list ? If not, you can store it on a server side List object and allow tenants to create/update/delete their own codes. After all you can merge server side common code list with the code list on the database for tenant.

  • User Avatar
    0
    leonkosak created

    DeviceType code list: NO ONE could add/edit/delete records. Code list is predefined and maintained by us developers only.

    Device: This is not code list. These are "concrete data".

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, it depends on whether your list of dedvice type can be overrided or not.

    if it can be overriden, then using IMayHaveTenant sounds reasonable.

    If it does not, you can consider using a table without multi tenancy concept to store such data (or even just a config file to store all the device types)

  • User Avatar
    0
    leonkosak created

    It cannot be overriden. So you suggest that such codelist (SQL table) is without TenantId column, BUT the data (rows) are copied in each tenant database (we want this code list that is stored in db)?

  • User Avatar
    0
    Samzzy16 created

    Please how did you end up implementing that list i have the same issue