locked
Is SyncServices pull or push? RRS feed

  • Question

  • I've been reading through the documentation and I still can't quite tell whether or not SyncServices is pull or push. What I mean by that, is does the underlying technology require the "client" to request each set of changes, or can the client subscribe to changes and get them real time, more like replication works in SQL server.

    I started reading a little about it, and it seemed like its more like a polling situation, but the documentation doesn't seem clear to me.

    Is SyncServices built on top of the same technology used for database replication, i.e. the publisher, subscriptions, etc

    Friday, May 14, 2010 2:53 PM

Answers

  • Hi,

    Your understanding is incorrect. Microsoft Sync Framework is for developers to write their own end-to-end sync application. If you are an end-user who do not have much programming experience and look for a complete end-to-end sync application for direct use, The current releases of Microsoft Sync Framework are not good choices for you yet. What you need is a sync application built either on top of Sync Framework or not.

    When a developer builds a sync application with Sync Framework, he has freedom to decide how to report changes and invoke sync such as pull or push patterns. Please read the MSDN document: http://msdn.microsoft.com/en-us/library/dd938837(SQL.10).aspx and try some samples: http://code.msdn.microsoft.com/sync to undestand Microsoft Sync Framework more. After reading the docs and playing the samples, if you still think that Sync Framework is not powerful enough for you needs, please let us know your feedback.

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 17, 2010 6:52 PM

All replies

  • Sync Fx synchronization must be explicitly initiated either to push (upload), pull (download) or both (bidirectional).

    It's completely different from SQL Server replication technology.

    Friday, May 14, 2010 3:45 PM
  • Hi,

    When implementing a sync application with Microsoft Sync Framework, you need to call Sync controller APIs (SyncOrchestrator in managed) to start a sync. From this point of view, it is a pull approach. If you need a pull pattern for your sync solution, you need to implement a custom server store monitor component that notifies your sync app when a change happens in your server and let the sync app to start sync immediately.

    If your change detection is implemented in push mode such as triggers in Sync framework SQL Server database providers. Your monitor component can follow the similiar approach to support real time sync.

    Thanks,

    Dong

     


    This posting is provided AS IS with no warranties, and confers no rights.
    Friday, May 14, 2010 5:48 PM
  • I'm still not clear. Let's say I have a client application, which is  trying to create a data cache in memory which represents what is in the database. Is there a way that the client application can initiate a "subscription" for a particular table, i.e. tell the server "I'd like a snapshot of table A, and please send me any changes to table A" and then get asynchronous updates?

    I want to avoid a situation where the client has to constantly query the database if there is an update.

    Friday, May 14, 2010 8:09 PM
  • Hi,

    With Microsoft Sync Framework, the data change of every store no matter in memory or not are tracked in a metadata store. The medata store can be in the same data store or a different one. It stores the item creation version, change version, is-alive, etc. You can use either pull or push model to implement the change detection method to update a metadata store. Sync Framework is not responsible for how to detect changes in your store, it only help you to track changes, identify incremental changes between different sync endpoints and resolve conflicts.

    Sync Framework also includes a few  sync providers for File System and Databases. It has its own change detection approaches. For example, FileSyncProvider is using a pull way to detect changes by scanning the local store when a sync is initialized. SqlSyncProvider is using a push approach with the SQL triggers. But for both of them, a sync session needs to be started by customer's sync application, Sync Framework doesn't provide a notification component for reporting new changes. It is customer Sync App's responsibility to implement such kind of components.

    Please look at Sync Framework more like a set of API libraries instead of a complete End-to-end solution.

    Thanks,
    Dong 


    This posting is provided AS IS with no warranties, and confers no rights.
    Friday, May 14, 2010 11:08 PM
  • So Microsoft Sync Framework doesn't really do anything for a developer. It's just some data structures? Sounds fairly useless unless it includes some real implementations based on real technology. Clearly MS has some very good "sync" technology already included in SQL Server to support database replication. I was hoping the the Sync Framework leverage that technology, but if I as a developer has to manage the how to detect changes for all types of stores, it becomes a waste of time.

    Monday, May 17, 2010 6:03 PM
  • Hi,

    Your understanding is incorrect. Microsoft Sync Framework is for developers to write their own end-to-end sync application. If you are an end-user who do not have much programming experience and look for a complete end-to-end sync application for direct use, The current releases of Microsoft Sync Framework are not good choices for you yet. What you need is a sync application built either on top of Sync Framework or not.

    When a developer builds a sync application with Sync Framework, he has freedom to decide how to report changes and invoke sync such as pull or push patterns. Please read the MSDN document: http://msdn.microsoft.com/en-us/library/dd938837(SQL.10).aspx and try some samples: http://code.msdn.microsoft.com/sync to undestand Microsoft Sync Framework more. After reading the docs and playing the samples, if you still think that Sync Framework is not powerful enough for you needs, please let us know your feedback.

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 17, 2010 6:52 PM
  • I am a developer, but I was hoping that it would be a "drop" in library that I could use to sync a local in memory store with a database table. Maybe it can do that, but the documentation is not clear about how it's intended to be used. Is sounds like it's meant for disconnected apps, not applications that are connected but need to know about updates in a database.
    Monday, May 17, 2010 7:48 PM
  • Hi,

    Hi,

    There is no built-in Sync Framework provider for in-memory store. Currently, sync framework only has built-in providers to sync File System and databases. For in-memory store, you can write a custom sync provider with Sync Framework. Most 101 samples in the MSDN site sample site are with in-memory storages.

    For your particular scenario, there is no existing sample as you said. Unfortunately, sync framework will not be able to provide all samples for the scenarios  that it can support because Sync Framework can be used to build many different sync scenarios.

    Regarding disconnected or connected apps, it is the sync app's choice. If my understanding is right, Sync Framework don't block you to build either one. For example, if you build a sync app from scratch, how will you invoke sync when a change happens on server? I believe that you need a way to notify your sync controller (it can be on server, client or third endpoints) that a change is available for sync, and a sync session will be started to send this change from server to client. It doesn't matter if server and client are connected or not. How to know which item is changed on the server, and how to know if client doesn't have a conflict change on the same item, you need to have a solution for it. Even if you notification includes the change and can apply to client directly, can you guarantee the change will always apply successfully? If apply fails, how to re-sync it? Sync Framework helps to solve these challenges. 

    Thanks,
    Dong

     


    This posting is provided AS IS with no warranties, and confers no rights.
    Monday, May 17, 2010 8:28 PM