Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preserving nodes and relationships history in a graph database

I am trying to implement a solution using Graph DB with nodes and relationships. There is a requirement where a user may want to run the reports (queries) on the historical data for a node, or check out the historical relationships.

Does Graph DBs support this functionality out of the box? or, if some alternate mechanism can be implemented to persist the historical audit logging enabled for the node/relation changes in the graph DB?

Some ideas which we can contemplate...?

like image 601
zzyzx Avatar asked Aug 04 '12 16:08

zzyzx


People also ask

How are relationships stored in graph database?

In a graph database, relationships are stored at the individual record level, while a relational database uses predefined structures, a.k.a. table definitions. Relational databases are faster when handling huge numbers of records because the structure of the data is known ahead of time.

What is node in graph database?

The graph database defined Graph databases use nodes to store data entities, and edges to store relationships between entities. An edge always has a start node, end node, type, and direction, and an edge can describe parent-child relationships, actions, ownership, and the like.

Is a graph database a relational database?

relational database. The most notable difference between the two is that graph databases store the relationships between data as data. Relational databases infer a focus on relationships between data but in a different way.

What are the advantages of using a graph database over a relational database?

Group by Aggregate Queries Due to the tabular model restriction, aggregate queries on a relational database are greatly constrained by how data is grouped together. In contrast, graph models are more flexible for grouping and aggregating relevant data.


1 Answers

You can use transaction event listeners to create historic copies of nodes and relationships as they are updates.

If you only have tree structures in your graph I recommend that you look at Persistent Data Structures with sparse copying and structural sharing.

For Neo4j there is an Github example project with versioning.

like image 161
Michael Hunger Avatar answered Oct 13 '22 06:10

Michael Hunger