By refering to https://support.aspnetzero.com/QA/Questions/9857/Reading-from-Read-Replica-database-and-write-to-primary-database, we are able to resolve connection string dynamically, and choose to use the read replica or primary database. This works for the host database.
We are using ASPNET Zero. In our setup, each tenant is using its own database, and its connection string is encrypted and stored in the abp_tenants table.
How do we support read replica / primary database setup, for these tenant databases?
3 Answer(s)
-
0
Hi,
In your custom resolver, you can get tenant record from database (Since you can resolve the host DB connection string), then, decrypt the tenant's connection string using
SimpleStringCipher.Instance.Decrypt
method. -
0
Thanks. Do you mean we need to provide a custom resolver for IDbPerTenantConnectionStringResolver?
-
0
Hi,
Yes, you need to create a custom resolver similar to
DbPerTenantConnectionStringResolver
.