Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Peer-to-peer replication and identity columns Expand / Collapse
Author
Message
Posted Monday, January 21, 2013 8:12 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 3:37 PM
Points: 31, Visits: 745
All of the articles regarding identity columns for peer-to-peer replication talk about setting identity ranges when writing to multiple members at the same time. In my case, It's going to be configured as a DR solution so only the primary site will receive updates unless there is a need to fail over to the secondary site which will be rare. Only one member will ever be making updates at any given time. In my implementation I would think that it would be desirable to have no identity ranges configured and to have replicated commands update the identity values so that the primary and secondary sites are in sync. Does this sound like a reasonable configuration?
Post #1409574
Posted Tuesday, January 22, 2013 5:02 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 5:03 AM
Points: 2,840, Visits: 3,975
jchamiak (1/21/2013)
In my implementation I would think that it would be desirable to have no identity ranges configured and to have replicated commands update the identity values so that the primary and secondary sites are in sync.
In transactional replication every article (table ) should have PK (in this case identity column as PK), So in P2p replication both side's table will have same schema (same identity column..same PK). so i dont think you can implement that , but better TEST what you think.


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1409954
Posted Monday, January 28, 2013 6:18 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, November 14, 2014 8:26 AM
Points: 2,896, Visits: 3,278
What you want to do sounds similar to what we have done.

We use P2P but send all our updates to a single node, which is identified using a DNS vanity name. At failover time we update the vanity name and our apps then connect to the new master node.

There one problem we have had to overcome. P2P does not update the identity seed value on receiving nodes. This means that after failover the new master node will want to insert records using an identity value that is already in use.

We have overcome this by writing some code that keeps track of identity value high-water mark, and automatically applying appropriate CHECKIDENT RESEED commands to the new master node at failover.


Original author: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2014, 2012, 2008 R2, 2008 and 2005. 18 October 2014: now over 31,000 downloads.
Disclaimer: All information provided is a personal opinion that may not match reality.
Concept: "Pizza Apartheid" - the discrimination that separates those who earn enough in one day to buy a pizza if they want one, from those who can not.
Post #1412391
Posted Friday, February 1, 2013 9:10 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 3:37 PM
Points: 31, Visits: 745
EdVassie (1/28/2013)
What you want to do sounds similar to what we have done.

We use P2P but send all our updates to a single node, which is identified using a DNS vanity name. At failover time we update the vanity name and our apps then connect to the new master node.

There one problem we have had to overcome. P2P does not update the identity seed value on receiving nodes. This means that after failover the new master node will want to insert records using an identity value that is already in use.

We have overcome this by writing some code that keeps track of identity value high-water mark, and automatically applying appropriate CHECKIDENT RESEED commands to the new master node at failover.


This is something that I will likely need to do as well. Now at least I have an idea to start with. Thanks for the feeback.
Post #1414728
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse