开发者

Best approeach in Neo4j

i am currently working on a project in which i have to implement a notifications system. I am a really starte with graphs dbs, so i dont know which would be the best approach to implement this. I have been thinking in two options:

1-Creating notifications nodes, relating them开发者_开发百科 to the user with a relation type pending or read. When i insert them i insert them like pending and when the user read them, i change the relation type to read.

2-Creating notifications nodes, relate them to the user and add some property to the relation..."status" (pending,read). Then add an index to that property.

I dont if i am well oriented, i would appreciate if you could point me in what direction.

Thanks in advance. Rodrigo


Rodrigo, it depends a bit on what amount of stuff you are going to expect, and how you are going to ask for this. I think something like

USER---READ--->TODAY---->Status1 | ----UNREAD--->TODAY---->Status2

Would both let you group status for both READ/UNREAD and some property regarding time or otherwise, when a lot of read status are starting to accumulate over time, while still letting you ask traversals over them ...

Would that work?

/peter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜