Titan 顶点中心索引与 Neo4j 标签 [英] Titan vertex centric indices vs Neo4j labels

查看:23
本文介绍了Titan 顶点中心索引与 Neo4j 标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在接近这个问题时,我试图在这两种技术之间进行比较,我想知道你们中的任何人是否已经拥有处理其中任何一种或两种技术的经验?在处理类似用例时,我主要对性能数据感兴趣.

I was trying to make a comparison between these two technologies when approaching this and I was wondering if any of you already have some experience dealing with any or both of them? I am mainly interested in performance numbers when dealing with similar use cases.

推荐答案

同意 Marko 所说的一切,可以更进一步,并认为在图数据库世界中,本地索引可以(甚至应该)替代全局索引.在我看来,图数据模型的最大优势在于它可以让您将数据模型编码到图拓扑中,从而在灵活性、易于演化和性能方面获得定性优势.考虑到这一点,我认为 Neo4j 中的标签实际上有损于这一切;将标签具体化为相邻边指向具有该标签的源的节点更符合模式即图"的理念.

Agreeing with everything Marko said, one could take it further and argue that in the graph database world local indexes can (and even should) substitute global ones. In my opinion, the single greatest advantage of a graph data model is that it lets you encode your data model into the graph topology, gaining qualitative advantages in terms of flexibility, ease of evolution and performance. With this in mind, I'd argue that labels in Neo4j actually detract from all this; reifying a label into a node with adjacent edges pointing to the source having that label is much more in line with the "schema is the graph" philosophy.

当然,如果您的引擎缺少本地索引,我们又回到了超级节点问题.但是,如果您确实拥有它们(我认为这应该是称为图形数据库的必要条件),您可以轻松地将标签转换为节点 L,并创建指向你想用 L

Of course, if your engine lacks local indexes we are back at the supernode problem. But if you do have them (something which I'd say should be a requirement for something to be called a graph database), you can easily transform your label into a node L, and create relationships pointing to that node for those vertices which you want labeled with L

<代码>v-[L]->升

意味着 v 有标签 L.现在,如果您希望 Titan 中的它表现得像 Neo4j 标签,只需将 -[L]-> 关系设为manyToOne"(请参阅​​ Titan 基数约束)并创建一个以顶点为中心的索引.这种模式可以让你获得标签所能获得的一切,还有更多;你可以

meaning that v has label L. Now if you want this in Titan to behave like a Neo4j label, just make the -[L]-> relation to be "manyToOne" (see Titan cardinality constraints) and create a vertex-centric index. This pattern lets you get everything that you could with labels and much more; you can

  • 有效地将其用作与该标签相关的属性的命名空间
  • 在一个标签内对元素进行排序
  • 轻松嵌套标签而不会降低性能(只需使用复合键)
  • 将标签 L 的声明与使用它标记的元素的访问方式分开
  • effectively use this as a namespace for properties relating to that label
  • sort your elements inside one label
  • nest labels easily without losing performance (just use a composite key)
  • separate the declaration of a label L with how elements labeled with it are accessed

这篇关于Titan 顶点中心索引与 Neo4j 标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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