Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vna_mhars
Starting Member
37 Posts |
Posted - 2011-03-14 : 23:22:06
|
Hi DB Guru, I have 1 existing DB server having 120GB data, and 1 application server. The management decided to have they called it DB Split. They decided to have 3 servers with the same Database and application. These servers will hold different client on each but they want it the same data in each server or synchronize, so I decided to implement P2P replication. My problem is when I implement some of the tables are not included in replication, the reason is because of no Primary Key (PK) in tables .. if I put additional column for(PK) i just think the implication of these in the application. Please advice me the best way to implement ... Thanks in advance ...Vernoldvamodente |
|
vna_mhars
Starting Member
37 Posts |
Posted - 2011-03-16 : 05:09:15
|
Anyone can advice me?vamodente |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-03-16 : 21:02:06
|
When you add the PK, you're going to have to make sure any application code, stored procedures, jobs etc don't break.Do a sweep through all of the code looking for references to the tables you're about to modify. Then make sure the code can handle it. For example, no code that does a select * then put the data into an array and assumes ordinal position.For the PKs, I would suggest identity columns, and seed them appropriately, so there can be no collisions between the three servers. |
|
|
vna_mhars
Starting Member
37 Posts |
Posted - 2011-03-16 : 22:20:30
|
Hi Russell, Many thanks for your respond, noted for that suggestion .. Thank you..vamodente |
|
|
vna_mhars
Starting Member
37 Posts |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-03-17 : 07:38:19
|
Read the comments.Identity columns are sometimes a perfectly good choice.In peer to peer replication, it is critical that the identity values don't collide.For example seed tables on server A (1, 3), those on server B (2, 3) and those on server C (3, 3).In peer to peer replication, this is one of the easiest ways to avoid Primary Key violation errors.Is it the best choice? Depends on your data. And your application(s). Sometimes it is, sometimes it is not.Dismissing identity columns out of hand is throwing away an important tool.That article is pretty flawed, as noted by the comments. I didn't read the whole thing, but the "identity columns are bad because" section is silly, and the arguments aren't valid. I can easily reject them on a point by point basis, which I won;t do for now. |
|
|
|
|
|
|
|