0

Right now we are using Janusgraph. Nodes and Vertices in our graph have entitlement tagged. We have customized the Gremlin server to check the entitlement after each step execution.

This Gremlin server is started using a Java app.

I am wondering if we can do the same thing for Neptune i.e. start a local Gremlin server and connect to Neptune DB and customize it for entitlement checks. Also, is it possible to configure a custom serializer for gremlin query response?

Adding the sample config:

host: MyNeptuneHost
port: 8182
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: conf/tinkergraph-empty.properties}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}}
serializers:
  - { className: org.myApp.tinkerpop.gremlin.driver.ser.MyAppGraphSONMessageSerializerV3d0, config: { ioRegistries: [org.myApp.tinkerpop.gremlin.tinkergraph.structure.MyAppIoRegistryV3d0] }}

1 Answers1

0

Amazon Neptune exposes the same entry point you would expect to see from any other Gremlin Server. So to your application, Neptune looks just like a Gremlin server. However, you cannot configure the serializers other than to specify the one you want used (by selecting one from the available set) when you create a connection to the server. It's not clear from your question how the entitlement checks are performed but you cannot customize the Neptune server itself other than to adjust the settings exposed via Parameter Groups and query settings (such as time outs).

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • [Have added sample config in original question] @Kelvin, thanks for your response. If I understand your point correctly, If I use the sample config mentioned in the question and start the Gremlin server to connect with Neptun DB, Gremlin server will not use MyAppGraphSONMessageSerializerV3d0 serializer from config while returning back the query response? – Sunil Sharma Jan 10 '22 at 05:27
  • Are you wanting to essentially chain two Gremlin servers together so that you call a Gremlin server which in turn calls Neptune and have that server transform the results that come back from Neptune? I have not tried that and am not sure what the performance would be like. – Kelvin Lawrence Jan 11 '22 at 21:00
  • Yes, I believe that's the only way of using a custom message serializer with Neptune. – Sunil Sharma Jan 24 '22 at 07:48