Hacker News new | ask | show | jobs
by tacone 3955 days ago
Not, benefits, differences.

Gremlin is an imperative "language", Cypher is declarative. The first lets you specify what will be performed, the latter describes the wished result and lets the query optimizer translate it to actual operations to retrieve it.

In a way, with Gremlin you have the absolute freedom on how to perform the traversal. With Cypher, you're working at a higher level with all the advantages of such approach (think SQL).

2 comments

Take a look at Gremlin 3 - it now supports both declarative and imperative queries. In fact, you can even mix and match the two.

You want to match a complex pattern? Use declarative Gremlin so the query optimizer can figure out the best execution strategy for you. You have a highly custom path traversal? Use imperative Gremlin which gives you full control over the execution and provides you with everything you'd expect from a pipeline language. You have both? Combine them in a single traversal.

While Gremlin2 was an imperative query language, Gremlin 3 is a new type of query language that aims to combine the best of both worlds.