Solved

Sync Framework Progress

Posted on 2010-09-19
3
2,570 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:aj2010
  • 2
3 Comments
 
LVL 51

Expert Comment

by:Mark Wills
ID: 33714726
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
 

Author Comment

by:aj2010
ID: 33716119
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
 

Accepted Solution

by:
aj2010 earned 0 total points
ID: 33759517
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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now