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

Support for FalkorDB #446

Open
flowt-au opened this issue Apr 28, 2024 · 0 comments
Open

Support for FalkorDB #446

flowt-au opened this issue Apr 28, 2024 · 0 comments

Comments

@flowt-au
Copy link

As you know, Redis has discontinued the Graph module and it has been "forked" into FalkorDB. For now, the vertx-redis-client continues to work ok, as does the Quarkus Redis Extension that wraps the Vert.x one. There are a couple of divergences from Redis already. eg the implementation of a GRAPH.COPY command.

In a test project I have implemented the GRAPH.COPY command to test that I could configure Vert.x to execute that command against the FalkorDB container. And yes, it works.

In essence, as a test:

Command GRAPH_COPY = new CommandImpl("graph.COPY", -1, false, false, false, new KeyLocator(true, new BeginSearchIndex(1), new FindKeysRange(0, 1, 0)), new KeyLocator(false, new BeginSearchIndex(2), new FindKeysRange(0, 1, 0)));

private Future<String> processGraphCopy(String src, String dest) {

  Log.info("FalkorGraphCommands.processGraphCopy src: " + src + " dest: " + dest);

  return this.redisClient
      .send(Request.cmd(GRAPH_COPY).arg(src).arg(dest))
      .compose(response -> {
        Log.info("RedisGraphVertx.processGraphCopy response=" + response.toString());

        return Future.succeededFuture("OK");
      })
      .onFailure(failure -> {
        Log.error("RedisGraphVertx.processGraphCopy failure=" + failure.toString());
      });
}

FalkorDB will continue to diverge from the Redis code base. One coming feature is support for map datatype on node attributes which will allow the nodes to contain "nested json". See: FalkorDB/FalkorDB#658.

I have had a look at cloning the vertx-redis-client to make a vertx-falkordb-client. ie remove all the commands for non-graph redis modules and include the FalkorDB ones. However, I am not very experienced with Java and for now can't spend the time to do a possibly 2nd-rate job of it. And, I imagine that once FalkorDB releases a version that returns the node attributes as maps, the vertx client will need work to handle that data type?

Anyway, I wanted to start the conversation to see if there are others who are interested and whether or not it was on the Vert.x development roadmap. I will have a go once FalkorDB is a bit further down their path but as I say am not that confident I can make a good version of it.

As another approach I also wrapped the official JFalkorDB client in Unis to make it reactive (it uses Jedis under the hood which is not reactive). It works, but is quite slow compared to the Vertx client. There is also Lettuce. However, I use Quarkus and it uses Vertx and it all works really well so a "native" Vertx FalkorDB client, then a Quarkus one :-), would seem to be the best approach long term, I think.

Any thoughts?

Thanks,
Murray

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

No branches or pull requests

1 participant