具有不可靠网络和低带宽的Java ORM策略 [英] Strategies for Java ORM with Unreliable Network and Low Bandwidth

查看:106
本文介绍了具有不可靠网络和低带宽的Java ORM策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个需要在不可靠网络中工作的系统的Hibernate。有一个我们需要读写访问的单个中央数据库,但是它可以通过一个非常不规则的Wi-Fi网络提供。此外,可能会有功率损失不能彻底关闭应用程序,因此任何解决方案都必须具有持续高速缓存,以保持电源周期。最后,这是一个只有适度内存和磁盘空间的嵌入式系统,因此例如对数据库进行全面复制并不是一个可行的策略。



我有一个基本的理解的Hibernate二级缓存,我想知道是否可以用Ehcache这样的东西来解决这个问题,但是这个主要的推力似乎是性能而不是可用性,所以我不知道这个缺陷可能是什么。

我也很乐意考虑涉及复制到本地数据库的其他策略。我宁愿不需要做太多的繁重工作来实现这一点。



寻找一些经验或可能的选择。

解决方案

水仙复制器(http://enterprise.replicator.daffodilsw.com/index.html)允许JDBC源之间的复制。它支持双向更新,合并和冲突解决以及部分副本。

这可以用于使主数据库与本地(部分)副本同步。您可以使用hibernate与本地副本数据库进行通信,并在该进程之外完成所有其他操作。


I am looking at Hibernate for a system which needs to work in an unreliable network. There is a single central database that we need read-write access to, but it is available over a pretty patchy wi-fi network. In addition, there may be power losses which do not shutdown the application cleanly, so any solution must have a persistent cache which can survive power-cycles. Lastly this is an embedded system with only modest memory, and disk space so for example doing full blown replication of the database is not a feasible strategy.

I have a basic understanding of Hibernate 2nd Level caching, and I am wondering if it is possible to configure this with something like Ehcache to solve this problem, but the main thrust of that seems to be performance not availability, so I am not aware of what the pitfalls might be.

I am also quite willing to consider other strategies which involve replication to a local database. I would rather not have to do too much of the heavy lifting myself to implement this.

Looking for some experience or possible alternatives.

解决方案

The Daffodil Replicator (http://enterprise.replicator.daffodilsw.com/index.html) allows replication between JDBC sources. It support bidirectional updates, merging and conflict resolution and partial replicas.

This can be used to synchronize the main database with a local (partial) replica. You can use hibernate to talk to the local replica database and have everything else done outside of that process.

这篇关于具有不可靠网络和低带宽的Java ORM策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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