2021年5月2日星期日

Graph database or relational database for tree structure data

I have company holding data with hierarchical structure. For example company A holds 50% of B, B holds 50% of C and D holds 50% of C. Each firm has their properties such as industry.

There are few write operations and mostly read. Specifically, starting from a set of nodes (root), extract the family tree by tracing down with certain percentage share threshold. There are several metrics of interest in the family tree.

For each node:

  1. the depth from the root
  2. the product of share layer by layer from the root, e.g. A holds 0.5*0.5 = 25% of C.

For each level:

  1. the distribution of share from each root
  2. the distribution of industry

Note that there could be multiple roots for each node and we are interested in all.

For now, the data is stored in a relational database and the task described above is done through joining. Would a graph database such as neo4j be more suitable for the data and this task? The crux of the problem is to have a proper index so that joining is not necessary for each time. Any suggestion and pointer would be greatly appreciated.

https://stackoverflow.com/questions/67363073/graph-database-or-relational-database-for-tree-structure-data May 03, 2021 at 11:08AM

没有评论:

发表评论