Toufic Zayed
Toufic Zayed

Reputation: 55

DSE graph: update the graph in analytics mode

I have a DSE graph in production. I want to update the graph based on the result of an analytic query.

For instance, for each vertex of type 'user', I want to count the incident edges with label 'subscribes', to calculate the number of subscribers of a particular user of the graph.

The count can be easily done with an analytic query in analytic mode (in transactional mode the query can timeout if there is too many edges).

The problem is that in analytic mode I cannot use the computed value to update my model.

When I try to update my counter I get this message: "property addition is not supported".

A workaround could be to count the edges in analytic mode, then switch from analytical mode to transactional mode, and then I can update the counter: this is OK to update a counter on a single particular user, but it's not really practical if I want to update all the users of my graph.

Is there a standard way to update the graph based on the results of analytics queries?

Thank you!

Upvotes: 0

Views: 147

Answers (2)

Toufic Zayed
Toufic Zayed

Reputation: 55

Ok to answer my own question: as answered by jlacefie, DseGraphFrames seems the way to go to run analytics queries and update the graph at the same time.

The purely analytic mode is not for update. But with writing a simple javascript client, with the dse graph nodejs driver, I was able to open two connections one OLAP and one OLTP, run analytic queries, get the result and use it to run OLTP queries to perform the update.

It is OK given the size of my database, but this approach cannot work if you have too much data to handle.

So the right answer to this question is to use DSEGraphFrames, unfortunately I cannot do it in my system since it doesn't work properly.

I will open a new question for this particular problem.

Upvotes: 0

jlacefie
jlacefie

Reputation: 614

Have you tried DSE Graph Frames for this solution? This may help with your goal.

https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/graph/graphAnalytics/dseGraphFrameOverview.html

Upvotes: 1

Related Questions