Neo4J Java Native APIs vs Traversal APIs vs Cypher

北城余情 提交于 2019-12-02 01:51:07

问题


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.


回答1:


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

  • 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.

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)

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.



来源:https://stackoverflow.com/questions/41055698/neo4j-java-native-apis-vs-traversal-apis-vs-cypher

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!