离线/在线数据同步策略 [英] Strategy for Offline/Online data synchronization

查看:322
本文介绍了离线/在线数据同步策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是我有服务器J2EE Web应用程序和客户端J2EE Web应用程序。有时客户可以离线。当客户端上线时,他应该能够同步更改。此外,我应该能够控制哪些行/表需要根据一些过滤器/规则同步。有没有任何现有的Java框架来做呢?如果我需要自己实现,你可以建议不同的策略是什么?

My requirement is I have server J2EE web application and client J2EE web application. Sometimes client can go offline. When client comes online he should be able to synchronize changes to and fro. Also I should be able to control which rows/tables need to be synchronized based on some filters/rules. Is there any existing Java frameworks for doing it? If I need to implement on my own, what are the different strategies that you can suggest?

我的一个解决方案是维护sql日志和执行相同的语句在另一边。你看到这个策略有什么问题吗?

One solution in my mind is maintaining sql logs and executing same statements at other side during synchronization. Do you see any problems with this strategy?

推荐答案

有很多Java库用于数据同步/复制。我知道的两个是 daffodil SymmetricDS 。在以前的生活中,我愚蠢地(在Java中)实现了我自己的数据复制过程。看起来像这样的事情应该是相当直接,但如果数据可以在多个地方同时更新,这是非常复杂的。我强烈建议您使用上述项目之一尝试并绕过处理这种复杂性。

There are a number of Java libraries for data synchronizing/replication. Two that I'm aware of are daffodil and SymmetricDS. In a previous life I foolishly implemented (in Java) my own data replication process. It seems like the sort of thing that should be fairly straightforward, but if the data can be updated in multiple places simultaneously, it's hellishly complicated. I strongly recommend you use one of the aforementioned projects to try and bypass dealing with this complexity yourself.

这篇关于离线/在线数据同步策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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