JanusGraph / JanusGraph/janusgraph

Add possibility to select `scylla` or `cql` dependencies in JanusGraph Server

Open
#3,580 6 comments 1 reaction 0 assignees View on GitHub
kind/enhancement storage/scylladb
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

ScyllaDB and DataStax Java Drivers cannot be together in JanusGraph Server because they have the same classpath. Thus, the only possibility to include Scylla drivers into JanusGraph Server right now is by manually replacing DataStax Java Drivers with Scylla Java Drivers.
It will be much more convenient is we add possibility to switch between `cql` and `scylla` drivers in JanusGraph Server using either environment variables or some configurations.
I don't know which approach is better but I would imagine something like below.

We ship all incompatible dependencies between `janusgraph-cql` and `janusgraph-scylla` in separate folders `libsScylla` and `libsCQL`.
We add an additional option to `janusgraph-server.sh` to include dependencies from `libsScylla` if there is an environment variable exists like the following: `JANUSGRAPH_SCYLLA_DRIVER_ENABLED=true`. Otherwise we include dependencies from `libsCQL` by default.

To make the feature described above we will most likely need to change `janusgraph-dist` flow of building JanusGraph distributions by changing the flow to something like below:
- Build JanusGraph distribution `libs` folder as usual using `janusgraph-cql` dependency
- Build JanusGraph distribution `libs` folder but now excluding `janusgraph-cql` dependency and including `janusgraph-scylla` dependency.
- Run comparison between jars in both `libs` folders. If the a jar from one folder `libs` has an identical jar from another folder `libs` (same `groupId`, same `artifactId`, same `version`) then this jar goes into general `libs` folder. Otherwise this lib goes to `libsCQL` or `libsScylla` respectively.
- After we placed all identical jars in `libs` folder and all different jars in `libsCQL` and `libsScylla` folder we continue with our usual build process (i.e. zipping the resulting archive).

If we change the process to be like above then it should be easy for any user to switch between `CQL` and `Scylla` driver implementations for JanusGraph Server quite easy by providing an environment variable. As Docker supports passing environment variables as well it should be easy to switch drivers in JanusGraph Docker distributions as well.

The initial problem to this issue was described by @FlorianHockmann [here](https://github.com/JanusGraph/janusgraph/issues/1778#issuecomment-667161302).

This issue is a continuation of ScyllaDB Driver integration PR: #3578

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing janusgraph-dist build flow and janusgraph-server.sh, then inspect the ScyllaDB driver integration in PR #3578. Define how the distribution should separate shared, libsCQL, and libsScylla dependencies and how the server selects them; done means both driver variants can be packaged and selected without manual jar replacement.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.