Search code examples
neo4jcypherneography

Neography: Traversal vs. Cypher


Im currently building something with Neo4j and Neography and were wondering what is preferred: Using the traverse method or a Cypher query?

Personally, I like Cypher, but I have no idea which is better/more performant


Solution

  • Cypher is indeed intuitive as Matthias pointed out, however I have the following recommendation:

    If its trivial stuff, go Cypher, its easier to write (actually a joy) and there shouldn't be any big performance penalty. However, once you have larger matchings or conditional queries, having domain knowledge of your graph might significantly boost performance if you use custom traversers or even Gremlin