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.