Best way to synchronize a remote SQL Server database with a local SQL Server Compact database?

I understand that this is a topic under discussion, but all the suggestions that I see are apparently related to direct access to SQL Server, which in our case is not ideal.

Our scenario is a remote SQL Server database with (say) 100 tables. We are developing a lightweight desktop application that will use the SQL Server Compact database and periodically synchronize a subset of (say) 20 tables with a remote server.

I would like to have control over how replication happens, because speed is our main concern, since the remote server is 1000 miles away.

Also, I do not need to synchronize all the records in each table - only those that apply to each user.

I really like the mechanism

+6
source share
3 answers

The fact that you are using compact db for the client imposes quite serious restrictions on the available options in this scenario.

Given the limitations and performance requirements you want, you might consider introducing a service-based endpoint to synchronize the tables you need. If your architecture allows this, then asynchronously it will significantly increase performance, but then again, it may not even be viable depending on your architecture.

Something else to consider is the use of web sockets, not standard HTTP connections for a web service, as mentioned above. This way you could synchronize clients in real time, as web sockets are real fully two-way connections in real time. The main catch with this is that you must either ensure that all clients are compatible with web sockets, or provide a return to emulate the connection to the web server using an emulation environment for clients that do not match the parameters.

Not sure if this helps.

+1
source

You have a choice as Sync Framework (requires more coding, as well as some other restrictions) or Merge Replication, working on the http / https protocol) - see this blog post for comparison: http://blogs.msdn.com/b /sqlservercompact/archive/2009/11/09/merge-replication-vs-sync-services-for-compact.aspx

+1
source

Can't you use the MS Sync framework?

Designed for your AFAIK script to a large extent.

A quick google turned this tutorial up ...

http://social.technet.microsoft.com/wiki/contents/articles/2190.tutorial-synchronizing-sql-server-and-sql-server-compact-sync-framework.aspx

0
source

Source: https://habr.com/ru/post/944531/


All Articles