Think about a simple scenario :
Every post posted by a user will have 5 tags. Now I can handle it in two ways:
Make separate vertex for each tag and attach it with post vertex
postVertex -------- [hastag] ------------> tagNameVertex
Add a property to
postVertex
say 'hasTag'postVertex[hasTag:tagName]
Which approach is good in case of searching a post by tag. What I was thinking that if 1000 users use 5 different tag then there will be 5000 tag vertex only but in second case no new tag vertex, just post vertex will handle it using property hasTag
.
We can use has()
to search based on tag so I think second approach will be good. right?