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

查看:393
本文介绍了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] - > L

意味着 v 标签为。现在,如果您希望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天全站免登陆