Handling Entity History Records

Hello

My background is in the database world, specifically data warehouses. Graph databases are a fantastic alternative to different approaches that we use in the data warehouse to improve data retrieval performance beyond indexing. We have one requirement that I'd like someone to explain, and that is handling history records.

From my understanding, a node is synonymous with a record that can have attributes associated with it. So, if I have an entity with n number of history entries where attribute data changed, we look for the newest record added based on the load date for the entity key and use it as the "Current Record." How do you implement this in a graph database with an ordered sequence of which record is active at the time of the date range requested in the query selection?

Thanks for your help.

You can create history nodes with a relationship from the entity to the history entity with a type like HAS_HISTORY. I would consider placing the date rang in the relationship instead of the history entity because query will be faster when searching for the latest version. This is because you will have to search for the latest version, which will requiring to interrogate each history entity. If the properties are in the relationship, neo4j will not have to retrieve the associated history nodes when search for the latest.

Thank you, Gary. That makes perfect sense to me. Would you recommend that the history primary key be the date loaded?