opencypher / cypher-for-gremlin

Cypher for Gremlin adds Cypher support to any Gremlin graph database.
Apache License 2.0
356 stars 48 forks source link

How do you make a server to run Cypher on JanusGraph on AWS Managed Cassandra Service? #346

Open bionicles opened 4 years ago

bionicles commented 4 years ago

There are few options for autoscaling serverless graph databases and I’m just curious because the graph database community really needs an on-demand scaling and pricing solution ...

how do you make a dockerfile which could be run in Fargate to run the cypher for Gremlin server on a JanusGraph with AWS Managed Cassandra Service storage engine?

Then we could have a graph database which only incurs costs while in use, and would scale automatically as needed. That’s critical for small projects with volatile loads

bionicles commented 4 years ago

Implementation Details:

This repo has docker images https://github.com/JanusGraph/janusgraph-docker — we just need to pass different environment variables, including the endpoint for Cassandra, https://docs.janusgraph.org/basics/configuration/ storage.backend=cql storage.hostname=cassandra.us-east-1.amazonaws.com

We could also potentially adapt this:

https://github.com/opencypher/cypher-for-gremlin/blob/master/docker/cypher-gremlin-server/conf/gremlin-server-modern.yaml

index.search.backend=elasticsearch index.search.hostname=100.100.101.1, 100.100.101.2 <— we’d need to put an aws elasticsearch hostname here? index.search.elasticsearch.client-only=true

From https://github.com/opencypher/cypher-for-gremlin/tree/master/tinkerpop/cypher-gremlin-server-plugin To enable Cypher query language: bin/gremlin-server.sh install org.opencypher.gremlin cypher-gremlin-server-plugin $VERSION $VERSION = 1.0.4

Then we could make a lambda function to call the janusgraph fargate load balancer endpoint: // yarn add gremlin@3.4.2

const gremlin = require('gremlin'); const client = new gremlin.driver.Client('ws://localhost:8182/gremlin', { traversalSource: 'g', processor: 'cypher'}); const cypherQuery = 'MATCH (n) RETURN n.name'

const results = await client.submit(cypherQuery);

results.map(console.log)

Here’s the manual for cypher query language; I like it because it lets us do Pattern Matching with the MATCH statement https://neo4j.com/docs/cypher-manual/current/