Search code examples
javasymmetricds

How SymmetricDs handles ID conflict if two store has has the same ID and they want to sync with Corp


if I have two stores ( store-1 and store-2) with table X and data as follow:

store-1 :
ID   NAME
---------
1    A


store-2 :
ID   NAME
---------
1    B

how they will be synced to Corp-000. Do I will have ID conflict ?


Solution

  • Another solution is to create a composite key at corp that includes location (or node id) along with your store ID. This will allow the data to co-exist in corp uniquely.

    Through SymmetricDS you can use a transform that utilizes a variable transform on this new location column to populate it with the node id on the fly as it is being replicated.

    If you need bi-directional replication for this data a column match router can be used to send the data from corp to store so that only the data for a specific store is replicated to the appropriate target store.