Answer the question
In order to leave comments, you need to log in
The ideal principle of category dependency?
Good, people.
The thing has come. It is necessary to organize categories of unlimited nesting. Basically, a standard feature in many engines. But here questions of the organization of such in bases meet different.
In general, in order not to waste too much time, I got into the engines to see how smart people are doing. And a little freaked out. Everywhere is different. Some have it all in one table. In the other, everything lies in one, except for dependencies with parents. This has been moved to a separate . In the third, everything is divided into 5 tables. In general, it was not possible to come to an unambiguous decision in any way.
I see everything as rather trivial. Three columns. Category ID, Parent ID, Category Name. If the parent ID is 0, then it is the root. If not, we build a tree, going up.
But I'm not a mega guru. I admit that I did not take into account something. Hence the question: what form of building dependencies among categories is the most appropriate?
Answer the question
In order to leave comments, you need to log in
It all depends on what requests will be and to what proportions. How often the dependency network changes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question