Serenity: Tenant Per DB support

Created on 22 Jun 2018  路  5Comments  路  Source: serenity-is/Serenity

In the guide documnet, there is already a tutorial about multi tenancy, It's great for the standalone app architecture,

But recently my project needs to shard DataBase by tenant Id, every tenant has an independent database, and one connection key may map to different connection strings.

I find it diffcult to handle this with Serenity, as I can not overrite static methods public static ConnectionStringInfo TryGetConnectionString(string connectionKey) in Serenity.Data.SqlConnections.

Does anyone meet this before?
I would appreciate any guidance.

community-support question

All 5 comments

why not make separate installs (like one app one DB) ?

You can use IIS location functionality and virtual directory

<configuration>
  <location path="customer1">
    <connectionStrings>
         [...]
    </connectionStrings>
  </location>
  <location path="customer2">
    <connectionStrings>
         [...]
    </connectionStrings>
  </location>
</configuration>

https://serverfault.com/questions/713152/how-can-i-split-out-connection-strings-for-an-iis-site-but-maintain-a-shared-ap

thanks @Estrusco

And how about Dot Net Core? (appsettings.json)

Does anyone have an example of MultiTenancy with core 2.x?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

dkontod picture dkontod  路  3Comments

JohnRanger picture JohnRanger  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

chintankukadiya18 picture chintankukadiya18  路  3Comments