none
I need a good example of Sync Fx change-tracking and metadata management RRS feed

  • Question

  • I would truly appreciate a very simple example of change tracking and meta data mgt. using one table named Tutorial with two columns, Col01 and Col02. In this case the table and both columns will be synchronized. This is a one-way sync going to an Azure sql database. The sync would not go both ways.

    I understand the scope defines what is synchronized. I understand that 3 triggers would be created on the Tutorial table (insert, update delete) in Azure. I understand stored procedures are also created for the Tutorial table in Azure.

    If I were to add a row to the Tutorial table and then do a synchronization up to the Azure database what happens next? When do the triggers execute and when do the stored procedures execute? when would change tracking happen and when would meta data management happen in this case?

    June T has a wonderfull explaination below from her blog jtabadero.wordpress.com. Thank you June!

    "The first step in configuring database synchronization in Sync Framework using the collaboration/peer-to-peer providers (SqlSyncProvider/SqlCeSyncProvider) is to define a scope. A scope is basically a unit or a grouping which defines what is going to be synchronized as a set. This is where you specify/list down which columns/tables to synchronize and what filters to apply when synchronizing. When you synchronize the scope, only the columns/tables included in the scope definition and the corresponding rows satisfying the filter are synchronized.

    When creating the scope (referred to as provisioning), Sync Fx creates objects in the database to enable change-tracking (keeping track of the inserts/updates/deletes in the tables) and metadata management. These objects consists of triggers on the tables being synched, stored procedures for updating metadata on what has changed and what has been synched, stored procedures for selecting and applying changes, tables for storing scope information/configuration and a tracking table for each table being synched to keep track of inserts/updates/deletes on that table."

    Thursday, July 3, 2014 8:00 PM

Answers

  • yes, the triggers update the tracking tables.

    the stored procedures selects and applies changes and updates the metadata as well (sync knowledge in the scope_info table)

    • Marked as answer by James R Traub Tuesday, July 8, 2014 4:21 PM
    Tuesday, July 8, 2014 2:22 AM
    Moderator

All replies

  • triggers for a table get fired when a write operation (insert/update/delete) occurs against the table. each of the table you include in the sync will each have a separate insert, update and delete triggers.

    the sync fx stored procedures execute during change enumeration and change application during synchronization.

    Friday, July 4, 2014 1:20 AM
    Moderator
  • June T said - triggers for a table get fired when a write operation (insert/update/delete) occurs against the table.

    Based on this I understand the table triggers update the _tracking tables?

    June T said - the sync fx stored procedures execute during change enumeration and change application during synchronization

    And sync fx stored procedures handle the changes made in the data tables?

    Thanks!

    Monday, July 7, 2014 5:24 PM
  • yes, the triggers update the tracking tables.

    the stored procedures selects and applies changes and updates the metadata as well (sync knowledge in the scope_info table)

    • Marked as answer by James R Traub Tuesday, July 8, 2014 4:21 PM
    Tuesday, July 8, 2014 2:22 AM
    Moderator