SQL Server Load Balancing with ASP.Net
-
Hi I'm running couple of SQL Server instances in two different instances, Instance A is the master which replicates the data to Instance B. Im running Transaction Based replication, which working well. Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B? Is there any load balancing mechanism available to do this? Thanks
-
Hi I'm running couple of SQL Server instances in two different instances, Instance A is the master which replicates the data to Instance B. Im running Transaction Based replication, which working well. Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B? Is there any load balancing mechanism available to do this? Thanks
C# forum is probably not the correct place for this, I doubt if the database forum will be any better but I would try there. You may be better served by using a dedicated database site - SQLServerCentral.com comes to mind. This really is a DBA type question (rather than a developer question).
Never underestimate the power of human stupidity RAH
-
Hi I'm running couple of SQL Server instances in two different instances, Instance A is the master which replicates the data to Instance B. Im running Transaction Based replication, which working well. Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B? Is there any load balancing mechanism available to do this? Thanks
satsumatable wrote:
Now I want to route the WRITE (Insert, Update, Delete) calls from my ASP.Net application to Instance A and READ (Select) calls to Instance B?
Have you tried anything? The databases only have replication running between them right? So that means that the two databases are distinct entities that can be connected to using separate connection strings. If your application has a dedicated DAL, all the change you need to make is have two separate methods that open a connection, something like OpenConnectionForWrite() OpenConnectionForRead() and your code can call the appropriate method depending on whether it's reading or writing.
SG Aham Brahmasmi!