I have a domain where I deal with data which has a parent/child relationship, of arbitrary depth.

Also, full time traversal needs to be enabled, to show the state of the data at a specific point in time.

Currently I am looking at two different types of databases, and was curious as to which would be more appropriate, or how I would overcome some issues in either of the solutions.

Any links to articles regarding this information would also be appreciated.

Solution 1: rdbms

  • good fit for time versioning with a solution like temporal tables in sql server (although the db needs to be open source and free, so I would have to add this to something like PostgreSQL)

  • not that great a fit for arbitrary hierarchical data; need to implement adherent list/nested set

Solution 2: graphdb

  • natural fit for hierarchical data

  • I don’t know a proper way to model time versioning in a way which is performant.

So I am looking on some feedback on the advantages/disadvantages of either database type, and how to overcome some of the shortcomings of either.

I personally was leaning towards an graphdb solution, where I add a start_time and end_time attribute to all nodes and relationships, but I am not sure about the performance and if there are any better ways to get time versioning.

The two main considerations are of course performance and simplicity of the query.

I realize this is a rather open question; I am merely looking to see if I am overthinking this or perhaps fail to take some other positives/negatives inti account.

  • Is it one giant hierachical structure or many small? Commented Apr 17, 2020 at 9:55
  • I don't think this is a good question for this forum. It feels like a "List of Software" and/or Opinionated question. But, each of your bullet points might be a good question on its own. Although, I think that the first one should be a duplicate as it is asking how to implement a Slowly Changing Dimension (SCD) Type 4. Commented Apr 17, 2020 at 12:46
  • @lennart it’s sections and subsections, user created of arbitrary depth.
    – moi2877
    Commented Apr 18, 2020 at 11:13
  • @michael I agree it’s probably not a great fit, but I can’t find the information anywhere else. I actually wasn’t familiar with changing dimension types, this already was interesting, thanks
    – moi2877
    Commented Apr 18, 2020 at 11:16
  • @moi2877 what did you end up using to meet your requirements? It is valid requirement with no clear solution in sql server, even though it has hierarchyID and level support, but more within same entity. Commented Apr 12, 2023 at 15:32

1 Answer 1


Every graph graph dbms seems to be handling these questions with their own unique ways. From what I know about neo4j, It appears that they can handle this somewhat similarly to how Dgraph Labs can. By placing facets, aka edge properties, on the edges, a kind of point in time graph could be interpreted. (I know more about Dgraph, so that is why I lean that direction with links.)

Here are a few discussions around this topic in Dgraph community:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.