Have you extended nested sets for hierarchical data modeling involving multiple parent nodes for a child node? What are your experiences?

前端 未结 2 1754
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 07:10

I am looking to use this concept in one of my upcoming project.

More info: Managing Hierarchical Data in MySQL.

Please share your experiences good or bad with ex

相关标签:
2条回答
  • 2021-02-10 07:27

    Your requirement for multiple parents immediately violates the fundamental nature of nested sets, as pointed out in your referenced article, so I'd say you're headed for trouble to start with. Since you'll be using a relational database, which (using it's core capabilties) will handle everything you've described so far, I think just working in that conceptual framework and polishing your skills will provide everything you need, without adding additional abstractions that (at least in this case) don't add any value.

    If you still want to go there, I'd call this a networked node structure. Here's a reference.

    0 讨论(0)
  • 2021-02-10 07:43

    As you will probably be using stored procedures for some operations, make sure that they really perform well enough for your needs! This could be a problem if you use MySQL, in my experience.

    Regarding the new requirement (multiple parents): You are now into much more problematic stuff when using a RDBMS, depending on what kind of queries you need to run against the data. I compared the RDBMS approach to using a graph database on this wiki page. If you are only interested in the RDBMS approach, take a look at A Model to Represent Directed Acyclic Graphs (DAG) on SQL Databases.

    0 讨论(0)
提交回复
热议问题