Open Closed

Abp MicroServices + MultiTenancy - Separate Database for each tenant #6995


User avatar
0
DominaTang created

Hi,

With latest ABP Framework Micro Service Template. Does it support separate database for each tenant. For example, when Tenant Id is value 'aaa", then DbContext point to Sql Server database 'aaa', when TenantId is value 'bbb', DbContext pointing to SqlServer 'bbb' within a MicroSerivce.

Thanks,


3 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, you can manage the connection string of a tenant https://docs.abp.io/en/commercial/latest/modules/saas#connection-string https://docs.abp.io/en/abp/latest/Connection-Strings

  • User Avatar
    0
    DominaTang created

    Hi,

    Yes, you can manage the connection string of a tenant
    https://docs.abp.io/en/commercial/latest/modules/saas#connection-string https://docs.abp.io/en/abp/latest/Connection-Strings

    I am talking about this use case, for example I have a Production Service, this service is used by users from different RAs, by checking API's tenant Id, for tenant A, the app read/write product to database "TenantA" db, for tenant B, the app read/write production to database "TenantB" db. Base on above page you mentioned (Different tenant connection string), when the code use Repository class, the ABP Repository is smart enough to access different database?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Base on above page you mentioned (Different tenant connection string), when the code use Repository class, the ABP Repository is smart enough to access different database?

    Of course, you can give it a try.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11