0

We recently experimented our production site with two connection strings (Say MainConnectionString and ReportConnectionString) , first one for the Database1 and the other for Database2. Both databases and the application are in the Azure cloud. Database2 was a just an replication of Database1. We did this experiment to see any performance improvements if all the reports uses a replicated copy of database specified in the ReportConnectionString. Unfortunately we couldn't gain anything from this experiment and keeping a replication database is costly.

We are now removing the Database2 and keep only Database1 for the production environment.

My query is, instead of changing the code to pull out the usage of ReportConnectionString from all the reports, is it a good idea to keep the ReportConnectionString and change the connection string to connect to Database1. Thus both connection strings will look at the same database. What are the ramifications of this. Just want to avoid the overhead of modifying the code for Reports to use MainConnectionString

3
  • Is there a switch in your code to determine when to use MainConnectionString or ReportConnectionString? Commented Apr 8, 2021 at 7:48
  • No. We have manually changed the each report dataset's connectionstring as ReportConnectionString to start the experiment. Reverting this back to original state may take programmer resources. I was looking for a shortcut to change the it in webconfig. Thanks for your query Ivan Commented Apr 9, 2021 at 0:13
  • In azure, we usually set the connection string in Application settings instead of .config file. And if you save them in Application Settings, then you can define the 2 connection strings there, and read the value as per your need dynamically. Commented Apr 9, 2021 at 2:27

1 Answer 1

1

Depending on your connection's that use that string.

Basically our ERP system contains several connection strings and it works really good. So basically you are the one who knows your code the most. If you are closing your connections after generating report by ReportConnectionString you wont have problems at, not even with garbage or either with connection pool limit.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes connections are closed implicitly by the nature of the coding, I suppose. So two connection string switch same database is not an issue at all means is a happy news :-) Later we will extend our design to build a denormalised database for reporting and this second connectionstring in the application code for reports will become handy at that time. Thanks for your answer Anyway

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.