Friendly Greetings !

While i'm recoding my app (using classes, Interfaces, factory and so
on) i think about the design of the graph base.
I'm re-reading http://en.wikipedia.org/wiki/Database_normalization and
the "normal forms" chapter of this page.

Here is my little brainstorming :

My first rule is the easiest : No node should have the same properties.
Well... that's obvious.

My second rule  is : a node should have only zero or one property
(some kind of "primary key"), everything else is a relationship to
other node.
But i can see here a "relationship spaghetti".

My third rule : a property that is unique to a node should be stored
inside the node property.
exemple : the "Social Security Number" of an employee

My third rule : a property with a high cardinality and not used in a
search query (sql "select") should be stored as property.
However, if this property is frequently queried it could be
interesting to create a node with this property and create a
relationship to this node.
eg :
i could have an employee "john doh" and store it as an inner property
: { "firstname" : "john", "lastname" : "doh" }
however, if i frequently need to retrieve all the employee with
lastname = "doh" i could create a "doh" node and link with a
"lastname" type all employee of the doh familly to this node.
And when i want to congratulate all my "doh" employee for having such
a common lastname, i just query the "doh" node to retrieve all node
that have an incoming connection on this node. which is fast, easy,
and efficient.

my 4th rule : a property with a low cardinality should not be stored
inside the node property. unless this property is never requested and
is small enough (to not bloat the database size).

i probably missed a lot of rule. What do you think about it ?
Any papers about Graph database design ?

Question : if i have large property of many KB (like a SQL "blob"),
and unique for every node (eg : the resume of an employee) is it more
efficient to store it in a separate node ? will it speed up node
traversal ?

thank you.

-- 
Laurent "ker2x" Laborde
Sysadmin & DBA at http://www.over-blog.com/
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to