与服务器离线数据库同步
我们有一个客户端-服务器架构,其中客户端在远程连接到服务器时会离线。 Server本质上是一个SQL Server 2008,只有几个表,每个表都有数千条记录。每个客户端应用程序 (WPF) 都需要存储服务器数据的副本以供离线使用(在 SQL Express 中?)。理想情况下,当客户端应用程序启动时,它会访问服务器以获取那里的新更改,并同步其数据库以具有与服务器相同的数据(无需太多用户交互)。
我正在寻找 100% 面向代码的解决方案,该解决方案可以部署到远程客户端,而无需耗时的设置过程或需要用户干预才能完成。一年前,我曾使用 Microsoft Sync Framework v1 及其 ADO.NET 同步服务来处理类似的情况。表重组、为所有其他更改跟踪场景编写 SPROC 变成了一场噩梦,而且批处理也很痛苦。 Microsoft 最近发布了 Sync Framework 的更新版本,其中包含一些新功能。我还没有时间评估这些功能。
是否有其他工具/技术可以将离线数据库与服务器同步?样品、文档、建议值得赞赏。
We are having a client-server architecture where client goes offline when connects remotely to server. Server is essentially a SQL Server 2008, with few tables each with thousands of records. Each client application (WPF) would require to store replica of Server data for their offline use (in SQL Express?). And ideally when client application starts up it would hit the server for fetching new changes over there and sync its database to have same data as of the Server (without much of user interaction).
I'm looking for 100% code oriented solution, which can be deployed to remote clients without time consuming setup procedures or that require user intervention to complete. I've used Microsoft Sync Framework v1 and its ADO.NET Sync Services to handle similar scenario a year ago. It turned to be a nightmare with table restructuring, writing SPROCs for every other change tracking scenarios, and batching was painful too. Microsoft has recent released an updated version of Sync Framework with some new features. I haven't got time to evaluate those features yet.
Is there any other tools / technologies to synchronize offline databases with a Server? Samples, documentation, suggestions are appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您研究过 SQL Server 复制吗?可以设置多种类型的复制拓扑。您的“离线”数据库可以在断开连接的环境中输入数据,然后在服务器可用时将更改与服务器同步。这可以通过 SQL Server 作业或通过 .NET RMO 类调用来完成。
Have you looked into SQL Server replication. Several types of replication topologies can be set up. Your "offline" database can enter data when in a disconnected environment and then synchronize changes with the server whenever it becomes available. This can be accomplished through SQL Server jobs or calls through the .NET RMO class.
我回到同步框架,这次将其与 SQL Server 2008 一起使用。结果更好,并且我能够通过 WCF 公开同步功能。请参阅此处的详细代码
I went back to sync framework and this time used it with SQL Server 2008. Results were better, and I were able to expose sync functionality over WCF. See detailed code here in SO