5

I have a SQL Server 2012 Enterprise setup issue and was so far unable to find a solution of my specific use case:

I have two SQL servers, one in the United States and one in Germany. Both are being used for reading and writing and the task is to make them synchronized. The good news is, that while reading happens a lot, writing only once every minute or so (to various tables however). Basically I am looking for a replication setup in which both servers are masters and can send changes to the other..

Is that possible?

Thanks, Christoph

4

3 回答 3

8

Either Merge Replication, Bidirectional Transactional Replication, or Peer-to-Peer Replication is the best fit here.

Since writes can occur at both servers, you will need to consider what to do in the event of a conflict. A conflict will occur when the same row/column is changed on 2 different servers between a sync. If possible, it is best to avoid conflicts altogether by partitioning the write operations. One way this can be acheived is by adding a location-specific identifier column to the writable tables and ensure that write operations for a particular row are performed at only one location.

Merge Replication provides bidirectional synchronization and the ability to define static and parameterized row filters to provide a subset of data to be published to subscribers. Merge Replication also provides built-in conflict resolvers along with the ability to implement custom conflict resolvers.

Bidirectional Transactional Replication provides bidirectional synchronization but does not offer any type of conflict detection or resolution.

Peer-to-Peer Replication provides bidirectional synchronization, however, it requires all nodes to be Enterprise Edition and does not support row or column filtering. Peer-to-Peer Replication has built-in conflict detection but does not offer automatic conflict resolution.

I would recommend setting each one up in your test environment to see which replication type best fits your needs.

于 2013-11-12T17:46:04.320 回答
3

Yes, for this you can use MergeReplication or Transactional Replication

They are both described in detail on the following page: http://technet.microsoft.com/en-us/library/ms152531.aspx

Each Table must have one field set up as rowguid. The Requirement for this is that it is of type uniqueidentifier. You should be aware of the fragmentation issues coming with the default value "newid". Instead of this you should make sure that the default value "newsequentialid" is used instead.

When setting up this kind of replication with the help of SQL Server Management Studio it should do this automatically. In the following post some details of newsequentialid and newid are mentioned: http://www.mssqltips.com/sqlservertip/1600/auto-generated-sql-server-keys-with-the-uniqueidentifier-or-identity/

于 2013-11-12T16:00:26.757 回答
1

You want to use bidirectional process. Yo can use merge replication with distributor on both servers.You can reach your goal by peer to peer transactional replication also it might cause conflicts so use merge replication which has conflict resolution.

于 2013-11-12T15:58:51.673 回答