Multiple Graphs in Gremlin Server?

How do I manage multiple graphs? Is there an option where I can select which graph to use for query or will the query check each graph present in the server?
2 Replies
spmallette
spmallette2y ago
This question hasn't been asked in a long time. You can host multiple Graph instances and GraphTraversalSource instances in Gremlin Server. You do this in the Gremlin Server configuration by way of the names you provide for your hosted Graph instances in the YAML file in the graphs configuration key and in the names you give to the bindings in globals in the Gremlin Server initialization script. you should read the "Starting Gremlin Server" section to get more information on how this is all rigged up: https://tinkerpop.apache.org/docs/current/reference/#starting-gremlin-server Once you have the Graph and GraphTraversalSource instances setup you can then reference them directly by name in your Gremlin when sending scripts or more commonly use "aliases" to rebind the names on the server to "g". You would need to consult the documentation for each programming language to determine how aliases work for that language. For java and bytecode requests you would do something like: GraphTraversalSource g = traversal().withRemote(DriverRemoteConnection.using("localhost",8182,"gmodern")); where "gmodern" refers to the name of a GraphTraversalSource configured on the server.
adityasinha2804
adityasinha2804OP2y ago
Thank you very much! Just changed example-groovy and gremlin server - graphs key Thank you!
Want results from more Discord servers?
Add your server