Base solution for your next web application
Open Closed

Multi database design #1653


User avatar
0
orangeboy created

We need to implement our database model so that all of the Abp tables are in the default database and all of our custom tables are in one database per tenant. We are having an issue where when we specify a connection string for a tenant then it also looks for the AbpUsers and other Abp tables in the tenant's database. We need to keep all of the Abp tables in the default host database. How can we configure the application for this approach?


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

    Hi,

    It is not possible to store all ABP tables in host database. Some of the tables needs to be in tenant database in database per tenant architecture, because they contain tenant specific entities.

    But you dont have to store host specific tables in tenant database. In order to do that, you need to derive your tenant db context from AbpZeroTenantDbContext and host db context from AbpZeroHostDbContext.