I have a website that is deployed on an environment as follows:

  • a load balance.
  • two web server.
  • two database servers.

both of the two database server have the same structure and queries. I found out that each one of them is storing different data than the other one and not connected.

i do not know much about this. i just need that any update that occurs on any servers be reflected in the other server.

EDIT: I stopped one of the servers and work on only one of them until we try the replication as it seems to be a wrong configuration.

  • You're going to have to provide a lot more detail; setup, error messages, etc. Have you asked the person who set this up? Commented Jan 24, 2016 at 15:03
  • 1
    there is no error message. it is just each time a request is sent to the database it is sent randomly to one of the servers which is crazy. Commented Jan 24, 2016 at 15:07
  • So, who set up the database servers? Did you consult these people? "It doesn't work" gives us absolutely nothing to go on. There's no way we can help you without more information. Commented Jan 24, 2016 at 15:08
  • the developers team agreed to stop one server and work on the other one. i guess this is the only solution for now, isn't it? Commented Jan 24, 2016 at 15:24
  • So you lose half of the data?
    – Tom V
    Commented Jan 24, 2016 at 15:29

2 Answers 2


Load balancing writes in SQL Server is hard. Are you sure this is actually a requirement? If not, and the servers just ended up this way because the implementers didn't understand the requirement, I would start with a single copy of the database that both web applications use, instead of trying to give each database an independent copy.

If it really is the requirement, then you could look into Distributed Partitioned Views, Peer-to-Peer Replication, Bidirectional Replication, or Merge Replication, all of which allow you to combine writes or otherwise share data from multiple instances. My guess, though, is that these solutions are overkill for your actual business requirements.

  • i started by stopping one of the servers and work on only one server and we will try the replication solution in order to work things out Commented Jan 25, 2016 at 14:20

i just need that any update that occurs on any servers be reflected in the other server.

This question is completely predicated on the assumption that you're wanting to run an environment where Server A matches Server B and that the application can connect to either at any given moment and that what happens in one should also then be sent or updated in the other. I based this on the above quote in your question (the comments might indicate some other goal).

Depending on the version (2005, 2008, 2008R2, 2012, 2014, 2016), you can look at merge replication as a possible solution here. Provided that the database structure is identical (lots of assumptions), if the application connects to Server A, then the data added, updated, or deleted will be sent Server B, if Server B is online to receive. Vice versa is true.

Not the answer you're looking for? Browse other questions tagged or ask your own question.