Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Done
-
3.2.9
-
None
Description
We seem to have established consensus that Gremlin Bytecode is the preferred way to execute Gremlin traversals instead of sending traversals as scripts to the server for execution. The Gremlin Server Application Maven archetype however still only uses the script variant:
public List<String> findCreatorsOfSoftware(String softwareName) throws Exception { // it is very important from a performance perspective to parameterize queries Map params = new HashMap(); params.put("n", softwareName); return client.submit("g.V().hasLabel('software').has('name',n).in('created').values('name')", params) .all().get().stream().map(r -> r.getString()).collect(Collectors.toList()); }
Since new users can use this archetype to get started with Gremlin, we should encourage best practices and therefore connect via withRemote to send the traversal as Bytecode.
Attachments
Issue Links
- links to