Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a pattern to synchronize data lists over network?

I've got a server app that offers data to a number of clients over network. You can imagine the data as a huge list of strings. The data on the server may change and need to be synchronized on all clients.

I'm currently using this approach: On initial connection, a client app requests all current data (which may be a lot of bytes). Then, it subscribes to updates (addition,s changes and deletions) of any data.

This works fine unless the data are changed on the server inbetween sending the initial data list and the app subscribing to changes - in that case, the client misses a few updates and works on outdated data without knowing it.

I believe this is a very common scenario, so there should be a pattern that solves the issue. I'm using C# 4 and WCF, but the pattern should be language agnostic I believe.

like image 919
mafu Avatar asked Nov 05 '22 11:11

mafu


1 Answers

Have you had a look at Microsoft's Synchronization Framework for .Net. It gives you finer control over what gets synchronized and how. WCF is fully supported. It supports incremental updates and synchronizing changes back to the server.

The API is pretty big and covers more than just Database Synchronization but there are plenty of articles out there. This should get you started:

Introduction to Sync Framework Database Synchronization

Synchronizing Databases

like image 54
Bronumski Avatar answered Nov 15 '22 01:11

Bronumski