views:

645

answers:

3

I have two identical servers with SQL Server 2005 and my application.

Hard requirements:

  1. I must be able to update data at either server.
  2. I must be able to unplug either server without having to reconfigure anything in the database.
  3. When a server is plugged back in, it must automatically sync up with the other server.

Notes:

  1. I prefer options that would not add significant load to the primary server if possible.
  2. The two servers have a private network for replication, so bandwidth is not an issue.
  3. It is ok for the data to be a few minutes out-of-date on either server.

From what I've read my options are:

  • Transactional Replication with Updatable Subscriptions (Queued updating)
  • Merge Replication

Which configuration best fits my requirements?

A: 

Have you considered Log Shipping?

I don't think that can easily be set up so that the Warm-standby can take over automatically, so some manual effort involved in making it the Primary.

And it will only be as good as the most recently received log - but you could set up to ship logs every minute or so.

If you have to have the Standby 100% up to date then you need a solution that syncs each transaction - which will be a Distributed Commit.

But if you are going to ship the Standby by FedEx and could force a process (i.e. to ship the "final" log) before it powered down that should work; or if its just disconnected, FedEx'd, and then comes back "online" the Log Shipping should just resume from where it left off; then when you make it the Primary it will be as "fresh" as the most recent log it has received.

Kristen
The standby doesn't need to be 100% up to date, it needs to be within a few minutes.
Eric Lathrop
The major point is that this needs to be *bi-directional*. The primary needs to update the backup when the backup comes online, and the backup needs to update the primary. It's okay to have a few minutes of downtime because the app needs to be stopped on one server and started on another.
Eric Lathrop
With Log Shipping you can't have both "on line" together. You can dismount ServerA (Primary), and "promote" ServerB (Secondary) to become the Primary, and you could have it set up so that ServerB then starts log shipping to ServerA - so ServerA can be promoted to Primary at some future date.
Kristen
(I used the term "Promote" advisedly, because it isn't quite like a replicated system where "Promote" might be a more accurate term - there will be some defined steps to go through to make ServerB the primary, and to subsequently, if/when needed, reinstate ServerA as the Primary)
Kristen
Sorry, NOW seen your edit about not wanting to have any steps to perform to switch servers etc. I am not sure whether you can do that with Log Ship. ServerB will have to change IP to that of ServerA in order to take its place - and I'm not sure to the extent to which that can be autoMagical.
Kristen
A: 

Since I can't comment on the first answer, not being registered, I will comment on it here. Mirroring can work without any intervention if you setup synchronous with a witness. The witness is a third sql server instance that automatically switches principal/mirror when it detects an outage. Also, depending on the amount of data, you could take the mirror out for a few days and when you return it, and the witness detects it, it will automatically beging to re-sync. In addition, depending on your application, you can create a sql connection string that will also automatically detect if the principal is down.

We don't have the money for a 3rd server or SQL server license.Also, having a 3rd server just for being a witness sounds like overkill.
Eric Lathrop
fyi, it can be any computer capable of running sql expres.
Sam
+1  A: 

None of the current options allow for having both servers being writeable. Pretty much your only option is going to be merge replication as this allows for updates to both servers.

However merge replication is the hardest to setup and get running. You will need to make sure that the distributor has enough drive space on it to ensure that the distributor won't run out of space the entire time that one of the servers is down.

Log shipping and Mirroring don't allow for updating the secondary server.

mrdenny
That's the conclusion I'm reaching. I'm doing some testing with merge replication right now. I have the update period set to every minute.
Eric Lathrop