开发者

Modelling alternatives and performance when traversing a tree structure in Neo4J

I modelled a tree structure using the Neo4J graph database. All nodes represent a category with a characterising name. So I have to traverse my tree very often from the root to a specific node / category. To which node depends on a list coming as input. This list contains strings representing the names of the categories from the root to the target node.

I wonder, if it would be effective to store these names as the types of the edges instead of a name property in the particular nodes. I thought that when I do so, Neo4J doesn't have to look for the fitting name property of every c开发者_开发知识库hild node every time going a step deeper in the tree. Instead Neo4J could lookup the name in the map that contains the outgoing edges.

What do you think?


Sounds sensible. How many different names do you have? If it is just categories those shouldn't be millions.

Did you load your data into the graph and run a performance comparison between both approaches? Is it a performance critical thing in your graph?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜