Neo4j triggers + Javascript Bolt to monitor Neo4j events

I am looking for a way to listen for a specific event in Neo4j, and the moment it occurs update a browser-only javascript web app. The event itself is the assignment of a specific property key to a node. It should happen real-time.

I feel it would create an overhead to poll the database for updates from the javascript app, particulary if there are a lot of types of events to monitor.

Neo4j itself offers triggers and the 'assignedNodeProperties' event and it can cause follow-on cypher queries to be invoked. If neo4j could push a message at that moment, it would be enough.

The Bolt javascript driver has reactive features but I can't see how to apply them to this. That would be an ideal place for this functionality.

I have experimented with a different database that accepts a socket connection and a subscription to updates for a specific data stream. The browser-only javascript app works fine with that solution.

Am I overlooking something?

1 Like

Hi @mojo2go,

The closest fit may be neo4j-streams, as mentioned here: Realtime notifications of node changes - #2 by david.allen

You're right to observe that the reactive driver features suggest the possibility of keeping a query "open" to get updates as they arrive, but that's not yet supported.


Thanks Andreas,
Adding Kafka to the picture looks like it's going to solve the problem--as well as offer a foundation for infinite other integration possibilities. I'll try it out. :slight_smile:

1 Like