Hello - I'm investigating ways to develop easier against our SQL database. The database may be hit by other teams deploying, maintenance or poor performing SQL scripts destroying any data integrity. 

I'm looking to create a clone database that we can point to as backup. If DB1 is down, we can point to DB2 to continue working on in the interim. I'd appreciate if anyone can provide information that would help us achieve addressing this.

  1. The server IP won't be changing
  2. Each database is a clone. All tables, stored procedures, security, etc will be the same.
  3. This necessarily doesn't have to happen at run-time

The question I'd like to ask is: is it possible to point to a different database with minimal configuration changes? I would assume this is possible if it re-uses what we have setup in our database extension. 

Thanks,
David

Very interesting question David!

So technically there are two approaches for this, one via configurations the other changes at run time.

In service center you can have multiple database connections, let us consider for a moment that you have 3 each one pointing to one database.

In the example I have 2 database connections:

And on the extension side you can specify (and change) which database connection to use:


For a runtime solution where you dynamically change the connection string you can use the PlatformRuntime_API / DatabaseConnection_SetConnectionStringForSession method:



Of course, I'm assuming you know exactly when to use each one of the databases and flip the connection manually either through a back office or via configuration.

An automatic change would probably be a bit more challenging to achieve.

Cheers