I am creating an MVP app for a client but I am skilled in iOS mainly with only some DB experience. I'm using MongoDB.
The schema is for a Product Catalog for small markets. The client wants a hierarchy of 4 super categories. I found this example at http://ift.tt/1egQcM2:
I understand why the pointers lead to their ancestors in this example, as the main action here would be searching for individual products, and then returning associated category data with it.
However, what about in a top-down search?
- First, I would have to query for all
Level 0Categories (such as Ragtime) - Second, I would have to query for all
Level 1Categories that point to Ragtime (such as Bop) - Third, finally query for
Productlevel items.
It seems like if the pointers were the other way around, I could perform this top-down search much faster. But I suppose then it would make it very difficult to include the category hierarchy in a Product level search.
This is the main tradeoff, correct?
Aucun commentaire:
Enregistrer un commentaire