Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
Hi there,

Please help me.

If we don't have pk and uk in a table for the replication and we need to reduce the latency while loading a report at a particular period of time n my application. Please suggest the best way to do it? Which replication is better? or do we have any alternative other than replication?

Please help

THank you


What I have tried:

1. We know that, at a particular period of time, we cannot able to view the report. This is the major issue. We are using Snapshot replication since the tables involved for the replication which doesn’t have a primary key.
2. Went through the types of Replication such as
a. Snapshot replication:
b. Merge replication
c. Transactional replication
d. Bi directional transaction replication
e. Peer to peer replication
3. If we work with any one of these replications, we can alter a column such as adding or dropping a column or multiple columns, etc.
4. We know that the tables which are involved for this replication does not have any keys (neither primary key nor a unique key). Analysed every replication type to pick the best replication which helps in our case.
5. As per the analysis, Snapshot and Merge replication can support even the tables don’t have primary key whereas for the Transaction, Bi direction transactional and Peer to peer replications the tables must have primary key or unique key to work with them.
6. To overcome the issue specified at the top, the snapshot replication is the bad option where is the data will be static most of the time.
7. Since our data is changing very often, we can go for Transaction replication or bi directional replication. The issue is the tables which are associated must have primary key on them.
8. Gone through the old back up technique concepts called ‘Data Mirroring’ and ‘Log Shipping’ which is not straight forward concepts as replication does.
Posted
Updated 1-Sep-16 18:32pm
v2

1 solution

You could use Merge replication, that doesn't require a primary key, and it automatically creates a rowguid column if it doesn't exist.
Unfortunately, you will have a performance penalty if using merge replication.
If you need to use replication for reporting only, and you don't need the data to be exactly the same as on the publisher, then you could consider snapshot replication.

Or please take a look at this link as well: Replicate tables without primary keys
 
Share this answer
 
Comments
Member 10914736 2-Sep-16 0:52am    
Do we have latency for the merge replication? Merge replication performance is poor than snapshot replication?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900