Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bionicles opened this issue Jan 10, 2020 · 1 comment

Comments

@bionicles
Copy link

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
Copy link
Author

bionicles commented Jan 10, 2020

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant