shree11
shree11

Reputation: 535

Tracking the history of nodes in neo4j

I'm using Neo4j Community edition 2.1.4. I have hierarchy of 4 levels and each level names i have treated it as label name for that level.So in my graph i have totally 4 labels. Now for the first time I have loaded csv file into neo4j and using MERGE and CREATEkeywords created the nodes and relationships. In future the requirement is like

scenario 1:

if someone wants to rename the hierarchy level name to some new name, then I have to   
change the label name to a new name.

Scenario 2:

if any of the property name of node changes to to new name 

In the both the cases i wanted to track the history of the node. How can i do it? So that in future someone wants to see the history details , they can query and get the details.

So how can i track the history details of the nodes in neo4j?

My Approch: For the first time i will load the csv file and create nodes and relationships. Then if someone wants to change the label name of node A(level name which is standard) which is having a properties like ID, name,start_date,end_date,Status.Then i will replicate the node A with all the properties and change the status to inactive and i will overwrite the old node with the new details. But i'm clueless whether this solution is going to work or not. Also i have more thane 10000 nodes in my db.

So please suggest me a better approach to track the nodes history.

Upvotes: 4

Views: 2464

Answers (2)

Christophe Willemsen
Christophe Willemsen

Reputation: 20185

You can use versionning. Examples in this blog post : neo4j.org/graphgist?608bf0701e3306a23e77 that you can adapt for your needs

Upvotes: 0

Michal Bachman
Michal Bachman

Reputation: 2661

Have a look at the GraphAware ChangeFeed Module. You can track history of changes and also configure which changes you would like to track and which to ignore.

Upvotes: 2

Related Questions