GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Performance: speedup remote gremlin traversal · Issue #1373 · ArcadeData/arcadedb

Performance: speedup remote gremlin traversal #1373

New issue
Copy link
New issue
Copy link
Closed
Closed
Performance: speedup remote gremlin traversal#1373
Copy link
Assignees
lvca
Labels
enhancementNew feature or requestperformance
Milestone
23.12.1

Description

@lvca
lvca
opened on Dec 10, 2023
Issue body actions

(From a thread on the official Discord Channel)

ArcadeDB provides the useful ArcadeGraph.traversal() that returns a Gremlin traversal. Since 23.11.1, ArcadeDB allowed to execute traversal even with a remote database instance.

While this works, it's sub-optimal because every step is executed on the server side. The best solution should be wrapping the traversal execution as a Gremlin Client call and executing it on the remote GremlinServer. This means the GremlinServer plugin must be activated on ArcadeDB server to use remote traversal.

The only issue with this is the transaction isolation: an open transaction on a remote database, and therefore remote ArcadeGraph, will be in a separate scope than the traversal. This means if a client is executing an insert of vertices, the transaction must be committed before executing the remote traversal, or the traversal will not see the newly added vertices.

Example:

  @Test
  public void executeTraversalSeparateTransactions() {
    try (ArcadeGraphFactory pool = ArcadeGraphFactory.withRemote("127.0.0.1", 2480, getDatabaseName(), "root",
        BaseGraphServerTest.DEFAULT_PASSWORD_FOR_TESTS)) {
      try (final ArcadeGraph graph = pool.get()) {
        for (int i = 0; i < 1_000; i++)
          graph.addVertex(org.apache.tinkerpop.gremlin.structure.T.label, "inputstructure", "json", "{\"name\": \"Elon\"}");

        // THIS IS IN THE SAME SCOPE, SO IT CAN SEE THE PENDING VERTICES ADDED EARLIER
        try (final ResultSet list = graph.gremlin("g.V().hasLabel(\"inputstructure\").count()").execute()) {
          Assertions.assertEquals(1_000, (Integer) list.nextIfAvailable().getProperty("result"));
        }

        graph.tx().commit(); // <-- WITHOUT THIS COMMIT THE 2ND TRAVERSAL WOULD NOT SEE THE ADDED VERTICES

        Assertions.assertEquals(1_000, graph.traversal().V().hasLabel("inputstructure").count().next());
        Assertions.assertEquals(1_000, graph.traversal().V().hasLabel("inputstructure").count().toList().get(0));
      }
    }
  }

Activity

  1. lvca
    self-assigned this
    on Dec 10, 2023
  2. lvca
    added
    enhancementNew feature or request
    performance
    on Dec 10, 2023
  3. lvca
    added this to the 23.12.1 milestone on Dec 10, 2023
  4. lvca
    added a commit that references this issue on Dec 10, 2023

    perf: executed gremlin traversal server side

    3666462
  5. lvca
    closed this as completedon Dec 10, 2023
  6. mergify
    added a commit that references this issue on Jun 21, 2026

    chore(deps): bump the github-actions group with 2 updates [skip ci]

    56a8912
  7. tae898
    added a commit that references this issue on Jun 28, 2026

    perf: executed gremlin traversal server side

    711cc06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

enhancementNew feature or requestperformance

Type

No type

Projects

No projects

    Milestone

    • 23.12.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.