客戶端-服務器同步模式/算法? - 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?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章