SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Peer-to-peer replication and identity columns


Peer-to-peer replication and identity columns

Author
Message
jchamiak
jchamiak
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 801
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?
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5328 Visits: 4076
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;-)
EdVassie
EdVassie
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5870 Visits: 3866
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 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005. 14 Mar 2017: now over 40,000 downloads.Disclaimer: All information provided is a personal opinion that may not match reality.Quote: When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist. - Archbishop Hélder Câmara
jchamiak
jchamiak
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
Points: 57 Visits: 801
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search