服务器设备的数据同步框架/算法? [英] Data Synchronization framework / algorithm for server<->device?

查看:165
本文介绍了服务器设备的数据同步框架/算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻求在服务器和分布式客户端之间实现数据同步。服务器上的数据源是mysql,django在上面。客户可以有所不同。更新可以在客户端或服务器上进行,并且服务器和客户端之间的连接不可靠(例如,可以在断开的手机上进行更改,当手机再次连接时应该同步)。 p>

S。 Lott建议在此问题中使用版本控制设计模式,这是有道理的。我想知道是否有任何现有的包/实现我可以使用。或者,我应该直接使用svn / git / etc吗?



还有其他选择吗?必须有同步框架或算法的详细描述,但我没有很多运气找到它们。如果你指出我正确的方向,我会很感激。

解决方案

AFAIK没有任何通用的解决方案,主要是由于不同的同步要求。



在我们早期的一个项目中,我们实现了一个 Spring批处理基于同步机制,依赖于每个表上的最后更新的时间戳记字段(同步)。



我听说过 SyncML ,但没有太多的经验。



如果您有单个服务器和多个客户端,则可以考虑基于JMS的方法。
数据被捆绑并放置在队列(或主题)中,并被客户端拉出。



在你的情况下,由于更新是双向的,你还需要处理冲突检测。这带来了更多的复杂性。


I'm looking to implement data synchronization between servers and distributed clients. The data source on the server is mysql with django on top. The client can vary. Updates can take place on either client or server, and the connection between server and client is not reliable (eg. changes can be made on a disconnected cell phone, should get sync'd when the cell phone has a connection again).

S. Lott suggests using a version control design pattern in this question, which makes sense. I'm wondering if there are any existing packages / implementations of this I can use. Or, should I directly make use of svn/git/etc?

Are there other alternatives? There must be synchronization frameworks or detailed descriptions of algorithms out there, but I'm not having a lot of luck finding them. I'd appreciate if you point me in the right direction.

解决方案

AFAIK there isnt any generic solution to this mainly due to the diverse requirements for synchronization.

In one of our earlier projects we implemented a Spring batching based sync mechanism which relies on last updated timestamp field on each of the tables (that take part in sync).

I have heard about SyncML but dont have much experience with that.

If you have a single server and multiple clients, you could think of a JMS based approach. The data is bundled and placed in Queues (or topics) and would be pulled by clients.

In your case, since updates are bi-directional, you need to handle conflict detection as well. This brings additional complexities.

这篇关于服务器设备的数据同步框架/算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆