客户端-服务器同步模式/算法? - Client-server synchronization pattern / algorithm?

问题:

I have a feeling that there must be client-server synchronization patterns out there.我有一种感觉,那里必须有客户端-服务器同步模式。 But i totally failed to google up one.但我完全没有用谷歌搜索一个。

Situation is quite simple - server is the central node, that multiple clients connect to and manipulate same data.情况很简单——服务器是中心节点,多个客户端连接到并操作相同的数据。 Data can be split in atoms, in case of conflict, whatever is on server, has priority (to avoid getting user into conflict solving).数据可以拆分为原子,以防发生冲突,无论服务器上的内容如何,​​都具有优先权(以避免让用户陷入解决冲突的境地)。 Partial synchronization is preferred due to potentially large amounts of data.由於潜在的大量数据,部分同步是首选。

Are there any patterns / good practices for such situation, or if you don't know of any - what would be your approach?对于这种情况,是否有任何模式/良好做法,或者如果您不知道任何 - 您的方法是什么?

Below is how i now think to solve it: Parallel to data, a modification journal will be held, having all transactions timestamped.以下是我现在想如何解决它:与数据并行,将保留修改日志,所有事务都带有时间戳。 When client connects, it receives all changes since last check, in consolidated form (server goes through lists and removes additions that are followed by deletions, merges updates for each atom, etc.).当客户端连接时,它会以合并的形式接收自上次检查以来的所有更改(服务器遍历列表并删除添加后删除,合并每个原子的更新等)。 Et voila, we are up to date.瞧,我们是最新的。

Alternative would be keeping modification date for each record, and instead of performing data deletes, just mark them as deleted.另一种方法是保留每条记录的修改日期,而不是执行数据删除,只需将它们标记为已删除。

Any thoughts?有什么想法吗?


解决方案:

参考一: https://stackoom.com/question/1jSg
参考二: Client-server synchronization pattern / algorithm?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章