locked
AnchorEnumerationSimpleSyncProvider: Support for Anchors RRS feed

  • Question

  • Hi,

     

    I am trying out the AnchorEnumerationSimpleSyncProvider and I am not clear whether Anchors can be effectively utilized using this provider. Lets take the case of Replica1 and Replica2 using anchor sync. To do so, both replicas need to store the last sync anchor from the other replica. That is  {Replica1, last_sync_anchor_Replica2}, {Replica2, last_sync_anchor_Replica1}.  Also, during sync each replica needs to know the replicaId of the other replica in order to properly determine the anchor.

     

    Now, AnchorEnumerationSimpleSyncProvider has a GetEnumerationAnchor() method that can be overridden.  That is fine, however when this method is called (by the sync framework) the provider does not have any knowledge of the replica (e.g. the replicaId) on the 'other' side.  Therefore calculating the anchor effectively does not seem possible.

     

    So, I am wondering if there is any way the sync process can be setup (e.g. using SyncSessionContext) so that Anchor sync can be performed?  AnchorEnumerationSimpleSyncProvider seems under-equipped to me.

     

    Thanks,

    Prasad

    Monday, December 8, 2008 6:16 AM

Answers

  •  

    Hi Prasad,

     

    "To do so, both replicas need to store the last sync anchor from the other replica. That is  {Replica1, last_sync_anchor_Replica2}, {Replica2, last_sync_anchor_Replica1}."

     

    Just to clarify the above statement, the anchor in AnchorEnumerationSimpleSyncProvider is between the provider and the local store only, the two replica's do not exchange anchors. The anchor represents a piece of information to be used by the provider to determine which items are locally changed. GetEnumerationAnchor is simply a convenience method used by the Sync Framework to store the anchor information for the provider, so that the provider wouldn't have to worry about how to store the anchor at next use.

     

    Hope this helps,

     

    Patrick

    Monday, December 8, 2008 8:01 PM

All replies

  • Hi Prasad,

     

    The AnchorEnumerationSimpleSyncProvider uses the store’s anchor just for local change detection.  Then synchronization with other nodes is accomplished using the Knowledge synchronization method of the Sync Framework.  So for your example, the two stores would each do local change detection using their local anchors.  Then they would exchange knowledge to determine what needed to be synchronized between them.  The advantage of this is that the provider can be written to take advantage of all of the rich semantics that Knowledge provides but still only have to know how to interact with its local anchor.

     

    Cheers,

    Mike Clark

     

    Monday, December 8, 2008 7:26 PM
    Moderator
  •  

    Hi Prasad,

     

    "To do so, both replicas need to store the last sync anchor from the other replica. That is  {Replica1, last_sync_anchor_Replica2}, {Replica2, last_sync_anchor_Replica1}."

     

    Just to clarify the above statement, the anchor in AnchorEnumerationSimpleSyncProvider is between the provider and the local store only, the two replica's do not exchange anchors. The anchor represents a piece of information to be used by the provider to determine which items are locally changed. GetEnumerationAnchor is simply a convenience method used by the Sync Framework to store the anchor information for the provider, so that the provider wouldn't have to worry about how to store the anchor at next use.

     

    Hope this helps,

     

    Patrick

    Monday, December 8, 2008 8:01 PM
  • I see. I now understand that anchors in sync framework are for local change detection alone.

     

    I was hoping that it was possible to exchange anchors; thereby each replica knows the time-span of changes to evaluate locally, without needing to first recieve the current knowledge from the other replica.  This makes for much faster synchronization (esp. given that current knowledge can be quite large and its transfer (even of its metadata alone) time consuming). Anchor exchange also helps in detecting out of date or restored relicas.  I understand that something similar to this is done in SyncML.  

     

    I see that AnchorEnumerationSimpleSyncProvider is not designed for the above.   It would be helpful if you could tell me how the above approach (or something similar) can be implemented via Sync Framework?

     

    Thanks,

    Prasad

    Tuesday, December 9, 2008 12:32 PM