Reputation: 101
My scenario is as shown in the above image. Here customer and shop will be using a windows form application and there is local DB for both. For example if customer checks for shops products and place order, it will store in local DB of customer and then push it to central server, from there particular shop should get the order details notification. similarly if order is approved, the data should be updated in central server as well as it should push to customer local DB as update.
we tried using SignalR For this, based on this article Is it correct to use SignalR for desktop applications? there is no direct support of signalR for windows Forms.
what about using Microsoft Sync Framework for this, will it be fine and do the job for me?
So is there any other technique to implement real time data sync in c# windows forms.
Upvotes: 2
Views: 2618
Reputation: 621
Answering this after almost an year but it might help someone else.
I recently worked on similar requirement. There are few libraries which could be helpful for this.
I used SocketIoClientDotNet and it is porting of javascript library Socket.IO, so it is very easy to integrate it. It is working great in my project but now it is deprecated. Still, you can use it as last version is very stable and there are very few open issues.
Upvotes: 0
Reputation: 3105
Some days ago,
I faced this problem and find out a solution. I hope you can get idea from my solution.
I called an api for transferring data(json) between shop to server and server to shop. I used same database structure for shop and server, Just added one extra field named shop_id to server and build up an composite primary key to server.
When needs to sync, user will press sync buttons then code will check the is_sync false data and send that data to api
Table structure:
id,....,is_sync
Interactions:
Shop->Server
Server->Shop
Upvotes: 0