Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Usage of triggers for updating nodes and relationships

Node Clone

I am working on a project where it could be useful to use triggers to update nodes and their associated relationships. In the context of this project there will be around 200.000 nodes and about 150 triggers.

Updates occur at least once per day on the nodes and for each update all triggers start, later maybe also once per hour.

My questions:

  • First, is it smart to use triggers for extensive operations on the database in a live scenario regarding inconsistencies?

  • Is it even traceable/auditable which trigger made a certain change afterwards and is it easy to rollback the change?

  • Is it best practice for live environments in regards of consistency? We are afraid it isn’t and moreover performance will drop.

Alternatively, we think about a classification mechanism which classifies our nodes according to some rules. What is better?



No I don't think it's a good idea to use triggers for this. If you have an explicit operation for these updates, just have a job or script to execute these updates in a consistent manner.


If you want auditing and more traceability, then using a tool like neo4jmigrations or liquibase for neo4j to execute these updates and then increment the db-version might make more sense.

Thanks for your answer, i will look into the two tools you mentioned.

Another approach we were thinking about is using node classification with gdsl maybe, so we would use a training set to train a model how to classify our nodes. Do you think that this is a viable alternative ?