cypher - Neo4J:Data Modelling - Creating too many relationships -
i working on use-case,in this
- there users.
- there tags.
- user shares posts(content) other users. , each post connected multiple tags.
thinking create user,tag , post nodes.
when post shared:
- relationships added between post node , user nodes(with whom post shared with, can 20 users).
- a relationships added between post node , post creator.
- relationships added between post node , tag nodes(can 20 tags)
i think adding relationships way helps retrieve posts user or tags.
posts created frequently.
my concern: feel approach creates lot of data(post node , relationships tags , other users) per post. also, think data grow fast posts shared , think each post creation expensive operation.
do think approach fine or there better way?
linking many nodes via meaningful relationships design because plays neo4j's strengths. if application has requirement know these relationships, design sounds me decent one. have other options; example, if wanted know tags post had, store tags array of strings inside of node property on post. have advantage of making easy maintain individual post's tags. have big disadvantage if wanted query posts tagged "cooking" slower since you'd have search node property called "tag" containing value.
your concerns "creating lot of data" , "post creation expensive operation" quite general. might valid concerns. might worries shouldn't concerned with. can't tell given information you've provided.
in general, modeling via nodes , relationships way go it, need substantial clarity on application requirements, , scalability needs on time provide solid answer question "is right design"?
Comments
Post a Comment