Base solution for your next web application
Open Closed

Reading from Read Replica database and write to primary database, for tenant #12049


User avatar
0
arctechnicalteamaus created

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)
  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    0
    arctechnicalteamaus created

    Thanks. Do you mean we need to provide a custom resolver for IDbPerTenantConnectionStringResolver?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes, you need to create a custom resolver similar to DbPerTenantConnectionStringResolver.