分离的智能客户端同步

发布于 2024-08-23 14:13:13 字数 275 浏览 2 评论 0原文

我目前正在开发一个应用程序,该应用程序最初仅安装在具有轻量级数据库(可能是 SqlLite)的客户端计算机上。

一段时间后,我想添加同一软件的网络版本,这样智能客户端就可以与在线版本同步。

有没有人做过类似的事情,我想知道:

  1. 最好的同步方式是什么,是否有相关模式?
  2. 有没有任何框架可以处理同步?
  3. 有什么我应该从一开始就注意的问题(也许是安全并发)?
  4. 构建这个的最佳方法是什么?

提前谢谢...

I am working on an application at the minute that will originally be just installed on a client machine with a lightweight database (may SqlLite).

After a while I want to add a web version of the same piece of software and with this the smart client will then be able to sync with the online version.

Has anyone done anything similar, I am looking to know:

  1. What is the best way of syncing, are there patterns around it?
  2. Are there any frameworks out there to handle syncing?
  3. Is there any gotcha's I should be aware of from the start (maybe security concurrency)?
  4. What would be the best way to architect this?

Thansk in advance...

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

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

发布评论

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

评论(1

宁愿没拥抱 2024-08-30 14:13:14

因此,微软的同步框架将对此有所帮助。 简介

一开始就有几个问题很突出。

如果您打算首先将数据存在于客户端上,然后在稍后的某个时刻同步到服务器,那么您需要考虑当多个客户端全部同步到服务器时会发生什么,尤其是。围绕冲突解决。

服务器端会引发一些事件来识别何时发生冲突,但您需要决定谁获胜。 (一个在服务器上,一个来自传入客户端)。根据您在此处选择的操作,第二次同步可能会修改客户端数据。

仔细考虑要同步的内容。如果它是联系人数据库,那么仅同步客户姓名和电话号码就足够了,还是还需要整个联系人历史记录?

考虑同步表,使用键均为相同值的行。即使这是一个带有触发器等的构造表。这使得框架同步过程更加简单,并且不太容易出错(表需要以不同的顺序同步)。

如果它是一个发票程序,可能需要一个仅上传的订单表,所有相关的发票、历史记录、报告表等都在服务器上更新,而不是在客户端上更新它们并同步多个表......

So, Microsofts Sync Framework will help with this. Introduction

Couple of issues stand right out at the beginning.

If you are going to have the data exisit on the client first, then sync to a server at some point later, you need to think about what happens when a number of clients all sync to the server, esp. around conflict resolution.

There are events that get raised on the server side to idetify when a conflict occurs, but you need to decide who wins. (one on server, one from incoming client). Depending on wht you choose to do here, the second sync is likely to modify the client data.

Think carefully about what to sync. If its a contacvts database, is it good enough to have just the client name and telephone number sync, or do you need to whole contact history as well?

Think in terms of syncing a table, using rows where the key is all the same value. Even if this is a constructed table with triggers etc. This makes the framework sync a much simpler process and less prone to errors (tables needed to be synched in different orders).

If its an invoicing program, maybe an upload only table of orders is needed, with all the assoiciated invoice, history, reporting tables etc being updated on the server, rather than updating them on the client and syncing multiple tables....

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