Sync Framework Progress

How do you track progress in MS Sync Framework 2.1?  I need to be able to monitor sync progress in bytes, as in the total number of bytes to download vs. how many have been downloaded so far.  The databases I'm syncing are hundreds of megabytes large and the clients have very slow connections, sometimes dial-up speed or even less.

SqlSyncProvider.MemoryDataCacheSize allows me to batch the downloads, which is nice for slow connections, but when synchronization is in progress I have no idea what's going on.

SqlSyncProvider.BatchSpooled will tell me when a batch has been downloaded, but only AFTER it has been download.  I need progress updates before and during streaming.  I also need to know the total number of batches and the sizes for each beforehand.

SyncOrchestrator.SessionProgress gives me some progress notifications, but not enough.  It gives me one notice at 50% of a scope and one at 100%.  It can take 20+ minutes before I even get to the 50% marker, so this is worthless.

Solutions please?
aj2010Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
aj2010Connect With a Mentor Author Commented:
My previous comment was indeed the answer.  By using an N-Tier implementation I was able to step in between the sync framework client- and server-side and control the data transmission.  I used a WCF service on the server and an interface proxy on the client-side.  Any communication vehicle could be used though.  
0
 
Mark WillsTopic AdvisorCommented:
Well, interesting problem....

From : http://msdn.microsoft.com/en-us/magazine/dd569762.aspx

We are told : "You can configure the provider to report the progress of the synchronization instead of using the default configuration. By default, the provider will report progress by calling the ProgressChanged event of the associated SyncCallback objects. You can change this behavior by implementing your own progress reporting. To do this, you need to implement events at the item level using the WorkEstimate event of the ItemChange class, or at the Batch level using the BatchWorkEstimate event of the ChangeBatch class. Then within your provider code, you can call the OnProgressChanged method of the provider to report the change whenever you think that is appropriate."

So, searching for examples, came across : http://msdn.microsoft.com/en-us/library/cc807387(SQL.110).aspx

Which leads into : http://msdn.microsoft.com/en-us/library/microsoft.synchronization.syncsessioncontext.onprogresschanged(v=SQL.110).aspx

Sorry about all the links, but it really wasnt until I saw your question that I even considered a custom progress bar (only use Sync Framework with really small data).

Anyway, hope it steers you toward a solution, and will be interested to see what other experts can post.
0
 
aj2010Author Commented:
The ProgressChanged event has basically the same problem as other events I previously mentioned, namely providing too little data.  WorkEstimate and BatchWorkEstimate provide more info, but still not at the level I require.  They just give me details about a specific batch, how big it is, the location of the batch file, and details about the batch itself, the scope, included tables, # records, etc.  The big problem is they only report info on batches AFTER they have been downloaded.  So it could take minutes or hours for a batch to transmit and during that time there are no events fired... so that makes it somewhat useless for what I'm trying to do.

At this point I think the only way to solve this problem is to move away from a 2-Tier implementation towards an N-Tier.  Then I would have a proxy between the sync providers.  I then use the sync providers to generate the batch files and use the proxy to manage transmission myself... which should put me in a position to monitor the status of the transmission.

I've been doing nothing but trying to figure out N-Tier since my last post to see if this will work.  There are not really any good examples of N-Tier, so I'm beating my head right now.  Help anyone?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.