持久化图形数据(Java) [英] Persisting graph data (Java)

查看:244
本文介绍了持久化图形数据(Java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个利用图形(树状)自定义结构的应用程序。结构不是真正的树,但几乎一切都连接在一起。数据量也很大(可以存在数百万个节点)。树节点可以在类型上有所不同,使其更有趣(继承)。我不想改变数据结构以适应持久性存储。

I have an application which utilizes graph (tree-like) custom structures. The structures are not real trees, but pretty much everything is connected together. The quantity of the data is also big (millions of nodes can exist). Tree-nodes can vary in type to make it more interesting (inheritance). I don't want to alter the data-structures to accommodate the persistence storage.

我想坚持这个数据,而不需要太多额外的工作。我有一些选项来解决这个问题,但没有找到任何适合我的需要。可能的选项:序列化,数据库与ORM(Hibernate?),JCR(JackRabbit?),其他什么?

I want to persist this data without too much extra work. I've goggled some options to solve this problem, but couldn't find anything that fits exactly for my needs. Possible options: serialization, databases with ORM (Hibernate?), JCR (JackRabbit?), anything else?

性能很重要,因为它是一个基于GUI的实时应用程序(无批处理),并且可能有数百万个图形节点,应该在内存和持久化数据存储之间读写。

Performance is important, because it's a GUI based "real-time" application (no batch processing) and there could be millions of graph-nodes which should be read and written between the memory and the persisted data store.

推荐答案

由于您的数据使用图形数据结构(基本上:节点和边/关系),图形数据库将是一个非常好的匹配。有关某些链接,请参见我的有关下一代数据库的回答。我是 Neo4j 开源图表数据库项目的一部分,请参阅这个线程的一些讨论。在像你的情况下使用Neo4j的一个很大的优势是,没有麻烦跟踪持续/激活对象或激活深度等。您可能不需要更改应用程序中的数据结构,但当然需要一些额外的代码。 设计指南提供了您的代码如何与数据库进行交互的一个示例。

As your data uses a graph data structure (basically: nodes and edges/relationships), a graph database would be a very good match. See my answer on The Next-gen Databases for some links. I'm part of the Neo4j open source graph database project, see this thread for some discussion of it. A big advantage of using Neo4j in a case like yours is that there's no trouble keeping track of persisting/activating objects or activation depth and the like. You probably wouldn't need to change the data structures in your application, but of course some extra code would be needed. The Design guide gives one example of how your code could interact with the database.

这篇关于持久化图形数据(Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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