Neo4J Java本机API与遍历API与Cypher [英] Neo4J Java Native APIs vs Traversal APIs vs Cypher

查看:304
本文介绍了Neo4J Java本机API与遍历API与Cypher的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人对Neo4J Java本机API,遍历API和Cypher进行了性能评估. 从性能角度来看,以上三个选项中的哪一个将为我带来更好的结果? 另外,对于写操作,我应该使用本机Java API还是cypher.是否有可能在本机API中批量执行DB操作,以便仅对数据库执行一次操作,而不是针对每个节点/关系创建进行操作.

Has anyone done the performance evaluation for Neo4J Java Native APIs, Traversal APIs and Cypher. Which of the above three options will yield me better result from performance perspective? Also, for write operations, should I use Native java APIs or cypher. Is there a possibility to bulk DB operations in native APIs so that it just hit the DB only once and not for every node/relationship creation.

推荐答案

您将对此

You'll be interested in this article. But the main takeaway from their tests is

  • Core API能够回答约2000个好友查询 (我必须承认在非常稀疏的网络上).
  • Traverser框架是 比Core API慢25%
  • 最坏的密码是 至少一个数量级只能回答大约100 FOAF,例如 每秒查询.我很震惊,所以我和来自 主要为cypher工作的neo4j.他问我哪个neo4j 我使用的版本是1.7.他告诉我我应该退房 1.9.自从Cypher变得更加出色.因此,我在neo4j 1.8和neo4j 1.9上运行了基准测试,不幸的是Cypher在 新的neo4j版本.
  • The Core API is able to answer about 2000 friend of a friend queries (I have to admit on a very sparse network).
  • The Traverser framework is about 25% slower than the Core API
  • Worst is cypher which is slower at least one order of magnitude only able to answer about 100 FOAF like queries per second. I was shocked so I talked with Andres Taylor from neo4j who is mainly working for cypher. He asked my which neo4j version I used and I said it was 1.7. He told me I should check out 1.9. since Cypher has become more performant. So I run the benchmarks over neo4j 1.8 and neo4j 1.9 unfortunately Cypher became slower in newer neo4j releases.

但是,除非在高性能情况下,否则我建议使用Cypher. (基本上,使用难度越大,速度越快.这取决于您平衡开发工作与性能.)此外,此数据是旧数据,Neo4j的每个主要更新都带有Cypher计划者可以使用的新技巧.用于更有效地查询.因此Cypher的性能将非常取决于数据库内容和Neo4j版本(好坏)

However, I would recommend using Cypher unless in a high performance situation. (Basically the harder it is to work with, the faster it can be. It is up to you to balance development effort with performance.) Also, this data is old, and each major update to Neo4j comes with new tricks the Cypher planner can use to query more efficiently. So Cypher performance will very based on DB content and Neo4j version (for better or worse)

此外,遍历API是基于Core API构建的,而Cypher则是基于Traversal API构建的;因此,您在Cypher中可以做的任何事情,都可以与其他2种一起完成.

Also, the Traversal API is built on the Core API, and Cypher is built on the Traversal API; So anything you can do in Cypher, can be done with the other 2.

这篇关于Neo4J Java本机API与遍历API与Cypher的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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