To separate content object and the data by its location in the hierarchy?

0 like 0 dislike
It sounds probably not clear so I will explain:

Suppose we have a tree of comments (Nested Sets or something, in principle, not important). Whether to make a field not related directly to comments (lft, rgt, parent_id, etc.) in a separate database table? On the one hand, we get rid of the binding to a specific structure of the review (you can always change NS to MP or something else), and with another — have difficulty with the Union of these tables.
by | 5 views

2 Answers

0 like 0 dislike
I think the question posed is wrong. The basis is a tree, not comments. IMHO, the tree is stored separately. For the above reason and further, you never know what else you want to stick in, it will be easier to do it with a clear wood than it. And the difficulty joyname there should be no...
0 like 0 dislike
Only for reviews (or other similar objects are United in hierarchy), IMHO, is not only unnecessarily increase the complexity when it is necessary to change the structure, then change it, may not will need, and may need to make multiple hierarchies.
Another thing, if the United hierarchy of heterogeneous objects, or one object can be part of different hierarchies — there is definitely (if not, the question is denormalization with the aim of increasing performance) the objects separately of the hierarchy separately, can also metadata make sense to endure. In General, for hierarchy makes sense, IMHO, to look towards NoSQL.

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
asked Mar 21, 2019 by Dair_Targ
110,608 questions
257,186 answers
32,835 users