Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2024

Gremlin Server Application archetype should connect via withRemote

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • 3.2.9
    • 3.4.0, 3.3.4, 3.2.10
    • documentation, server
    • 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

          Activity

            People

              spmallette Stephen Mallette
              Florian Hockmann Florian Hockmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: