question

sakuraime avatar image
0 Votes"
sakuraime asked TiborKaraszi commented

what's the difference between peer-to-peer vs merge replication

what's the difference between peer-to-peer vs merge replication in sql server ?
both support multiple node write .

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasKreuzberg-1289 avatar image
0 Votes"
AndreasKreuzberg-1289 answered

Hi,
I just used google:

The main difference is that for merge replication there is only one publisher and one or more subscribers, but in peer-to-peer replication all nodes are both publishers and subscribers

I hope that will help you.

Kind regards,

Andreas

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TiborKaraszi avatar image
0 Votes"
TiborKaraszi answered TiborKaraszi commented

Peer-to-peer is based on the transaction log, it is transactional replication where all are both publishers as subscribers. Basically "chaos", although there is conflict detection and in the very last CU for SQL 2019 also "last one wins" option.

Merge is based on triggers which fires when data is modified and reflect those modifications in your database, Then the merge agent uses that info to perform the modifications on the other "node" when it does the merge. this includes conflict detection and resolution.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

amm... interesting , which means Merge replication doesn't need to read the transaction log ??

During the implementation , it requires everytable to have an uniqueidentifier column (even have unique PK) ....is it true ??
146453-image.png





0 Votes 0 ·
image.png (50.0 KiB)

Correct, merge doesn't use the transaction log.

Correct again, a unique identifier column with the riwguidcol is needed for merge. Merge doesn't need a PK, though (but if one exists, it has to be included in the article).

0 Votes 0 ·