I'm using Neo4J to persist a XSD in graphical format. Every Node in the graph has an attribute which is a list(array) of Strings. My query will be based on this arraylist.
For example: To keep it simple, let's say every node in the graph will have list of alphabets as one of the attribute. Now my query needs to yield all the nodes containing 'C' in the arraylist.
My question is, whether I should move all the alphabets from the attribute arraylist to individual nodes attached as child node to every node. If I do that, my query will change to yield all the nodes whose child node contains 'C' as it's value.
Which of the above two approaches is more efficient. Having an attribute as arraylist or having separate child nodes containing the individual values of the arraylist.
In real scenario, that arraylist can contain thousands of entries. So, if I go ahead with second approach and create separate node for each arraylist value, the tree will bloat up in size.
But I need to know READ efficient approach out of the two.