2
votes

I'm currently looking to use Microsoft Sync Framework (2.1) to sync clients (running SQL Server Express) with a cloud based central data store, using WCF for all communications.

The central data store is a SQL database, with a scalable number of processing nodes connected to it, each with an instance of my WCF service to process sync calls.

There could be a large amount of data transferred from the server to the clients when syncing, so I think batching is necessary to avoid out of memory issues, better handle unreliable connections, etc. My problem is that the N-tier examples I've seen seem to require an instancing mode of PerSession on the WCF service end, and batch files are stored to a location on disk, which isn't an option as there is no guarantee subsequent calls will go to the same processing node, so my WCF services are all set to PerCall instancing.

What is the best way for me to tackle this batching problem? Is there a way to store the batches on a central data store (say my server database) or is there an alternative to batching to reduce the size of the dataset to 'bite sized' transfers that will be more robust?

1
I should probably add that the clients will be syncing with each other too, so it will be a collaborative scenario, so from what I've read I should be using SyncOrchestrator and KnowledgeSyncProvider (or inherited children of). And if it's any help, this sample seems to demonstrate most of what I want, apart from the PerSession instancing. - Ross McCulloch
is the cloud store on SQL Azure? - JuneT
No it's not running on Azure, but essentially our infrastructure is the same as the VM Roles offered by Azure I think. Each node is a machine image that can process calls, and we can add in or remove nodes arbitrarily at any time, requiring that everything be stateless. - Ross McCulloch

1 Answers

1
votes

the batching in Sync Framework is just for the transmission of the changes, not the application of the changes. so if you have a sync session whose changes are batch into 10 batches, a single batch is not applied individually. rather, the entire 10 batches is applied as one. internally, the batches are actually byte arrays that are reconstructed to a dataset. so you can't have part of the batch in one node and the others on other nodes.

not sure if it helps, but the Windows Azure Sync Service sample may offer you some patterns on how to go about storing the batch file and the writing a similar service and handle the batching.

have a look at Walkthrough of Windows Azure Sync Service Sample