1

In my project, we use python to connect to Neo4j and run the cypher queries. Are there any inbuilt auditing techniques with Neo4j? If not, could anyone please give suggestions on methods to achieve the same. I want to audit every single change to nodes, relationships and the attributes. Currently, we are thinking of querying Neo4j to know whether it is a create or update and get a list of attributes with new values. These values will later be inserted into a table in cassandra. This seems to be expensive to implement and messy. If anyone could point me towards a more elegant method, it would be greatly appreciated.

Thanks in Advance, Anusha

Anusha R
  • 11
  • 1
  • Hello. Take a look in [this question](https://stackoverflow.com/questions/45669949/neo4j-how-to-model-a-time-versioned-graph/45817643#45817643). – Bruno Peres Oct 10 '17 at 11:17
  • Thanks for the comment. In our project, we are looking at millions of nodes, hence a method which has complex or performance affecting queries will not work. I am really looking for any inbuilt transaction handling mechanisms in neo4j that will work with python. – Anusha R Oct 11 '17 at 03:48

1 Answers1

1

You can try using triggers from the apoc library. For example:

CALL apoc.trigger.add(
  'auditCreateNodes',
  'UNWIND {createdNodes} AS n 
   ...audit actions...',
  {phase:'after'}
)
stdob--
  • 28,222
  • 5
  • 58
  • 73