使用 Microsoft Sync Framework 2.1 同步整个数据库

发布于 2024-12-09 10:44:11 字数 662 浏览 1 评论 0原文

我需要能够将多个远程数据库与我的主数据库同步、上传和下载。

然而,问题在于我需要同步整个数据库,并且数据库模式将不断更新,并且我没有看到任何方法对其进行编码以获取整个数据库模式而不添加每个单独的数据库模式表到 SyncScope

这是有问题的,因为范围总是在变化。我解决了删除现有范围并添加新范围的最初问题,但我仍然找不到任何简单的解决方案,无需查询系统表,解析结果,并将这些结果(150+)表传递回我的 <代码>SyncScope。

我最初考虑同步框架的原因是:

  1. 当我通过 C# 通过单击按钮以编程方式执行同步时,我需要能够管理同步的方向(上传/下载)。
  2. 我需要能够根据他们的网络连接打开该按钮。
  3. 同步下载还需要完成其他任务,例如更改移动设备的连接字符串,以及将有关其连接和设备的信息存储在数据库中。
  4. 同步上传时还需要运行其他任务,例如通过我的 OR/M 根据客户业务规则验证数据、将数据存档到网络存储、重新启动应用程序以及再次更改连接字符串。
  5. 最终,我需要部分数据集,由客户在运行时、对象级别、OR/M 框架中决定/选择。这些对象可能与我在设计时不知道的一个或多个表一致,或者甚至可能在设计时不存在。

有谁知道另一个框架是否包含我的所有要求,或者是否有更简单的方法在同步框架中执行此操作?

I need the ability to sync multiple remote databases, upload and download, with my main database.

However, the problem lies in the fact that I need to sync the entire database, and the database schema is going to be being updated constantly, and I didn't see any way to code it to grab the entire database schema without adding each individual table to the SyncScope.

This is problematic as that scope will always be changing. I solved the initial problem of removing the existing scope, and adding a new one, but I still cannot find any simple solutions, without querying system tables, and parsing the results, and passing those results (for 150+) tables back to my SyncScope.

The reasons I originally looked at Sync Framework are:

  1. I need to be able to manage the direction of the sync (upload/download) when I do a sync programatically from C# on a button click.
  2. I need the ability to turn on that button, based off their network connectivity.
  3. There's additional tasks that need to be done on a sync download, such as changing connection strings of the mobile units, and storing information about their connection and unit in the database.
  4. There's additional tasks that need to be run on a sync upload, such as verifying data against customer business rules through my OR/M, archiving the data to a network storage, restarting the application, and changing connection strings again.
  5. Eventually, I need partial data sets, decided/chosen by the customer, at run-time, at the object level, in an OR/M framework. These objects, may coincide with one or more tables I won't know of at design-time, or may not even exist at design-time.

Does anyone know if another framework encompasses all my requirements, or if there is a simpler way to do this in the sync framework?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时间你老了 2024-12-16 10:44:11

对于此任务,尤其是在架构发生变化的情况下,您可以考虑合并复制而不是同步框架。

For this task, especially with a changing schema, you could consider Merge Replication instead of the Sync framework.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文