[Neo] Node with the millions of incoming relationships "to" - is this a proper way ?

Dmitri Livotov dmitri at livotov.eu
Mon Feb 8 14:25:40 CET 2010

A kind of architectural question now

We're thinking on our graph model now, where we will have a lot of nodes 
of particular type. Something like the filesystem, where each fs element 
(node in neo4j terms) could be of type "file" or "folder".

We need to be able to separate and later query (filter) nodes by type. 
In some cases, we'll also need to iterate over
all nodes of some type and so on. For now, I do see two ways for 
defining the node types in the database:

- first is to define so called "class nodes", say "File class" node and 
"Folder class" node and then every node in the database will have the 
extra relation either to "File class" node or "Folder class" node. This 
way I can easily find all nodes of particular type and so on.

- second way - to define a property in every node, say "nodetype", with 
the appropriate value for every node.

First way seems to be more correct for me, but Im concerning that there 
will be a millions of relations to a single node - is this OK for the 
database performance and deficiency (millions to one relationship looks 
like an unbalanced graph) ?


More information about the User mailing list