Reputation: 1803
I have a database which will store a number of users and the items belonging to those users. users and items will be stored as nodes. My initial approach was to have a user node with properties of username, email, and item with properties name and category, with their inbetween relatiohsip being:
(item)-[BELONGS_TO]->(user)
After reading an article in the neo4j blog, I moved the category property into a separate node, as it may belong to multiple items.
What I am concerned about is that now in a scenario of thousands of items, category nodes would have thousands of relationships. How would that affect the overall performance if I were to search for a single item and the categories it belongs to?
Upvotes: 0
Views: 341
Reputation: 2666
Dense nodes are indeed an issue (and there's quite a few approaches to increase the performance / solve the issue). Having said that, the denseness here is on the side of the category (1 category having thousands of relationships with items). If your entry point into the graph is the item however ... getting all the categories it belongs to (just a few I imagine) should not cause any problems whatsoever.
Hope this helps, Tom
Upvotes: 1