Subscribe to RedisGraph Changes

Is there a way to subscribe in gears to redisgraph specific events, like node or edge creation?

@jrideout

AFAIK as of now modules can’t trigger key space notification for any changes. So you can’t trigger redisgears in such case. @meirsh please correct if I am wrong.

@jrideout please elaborate your use case, we may help you something as work around.

@suyog We have raw data that looks roughly like an edge stream:

A -> B -> C
Z -> Y -> Z
Z -> B-> C

We expect a high number of redundant edges in the data.

and every time we observe a new edge want to A) run an ML algorithm that result in setting a property on that edge and B) emit to a pub/sub both the new edge (with some local structure of all nodes/edges one relation away from the nodes of the new edge) and the resulting edge properties. We have a variety of use cases for these edges ranging from customer alerts to automated workflows depending upon the context.

It seems to me one approach might be:

  1. post the edges stream as json-blob to redis stream
  2. have a gears read the stream, query to see if each edge exists
  3. if the edge doesn’t exist 3a) post new edge to new-edge-stream 3b) create new edge

I was hoping for something like:

  1. post the edges stream as json-blob to redis stream
  2. have gears MERGE the edge
  3. have a gear monitor for new edge creation
  4. in the edge-listener post new edge to new-edge-stream

We probably could do something else too, like store each edge in a SET and monitor for new values, outside of graph.