如何在 NEO4J 中存储社交网络的动作?
How to store social network's actions in NEO4J?
我们将把 NEO4J 用于我们的社交网络数据库,我们有常见的社交网络操作,例如关注、link、评论、posts 等等...。
现在我想知道这是否正确,我们正在做:
Comment: user_comment is a node and has a relation with post node, relation name is comment
Like: Like is a relation, the relation name is like and a post has a
relation with a user, the relation name is like
Location: Each post can have a location, then post node has a where relation with location node. (We use Google map API for locations)
tags: Each can have some tags, if tag is exist as a node we just define a relation to tag, then post node has tag relation with tag node
media: media node has media relation with post node
好的,请告诉我以上定义和关系是否正确,或者我们可以做其他事情吗?
例如,点赞操作(收藏)是否应该是用户与 post 之间的关系?或者我们可以做点别的?等等上面的其他节点...
听起来很合理。
您还可以选择仅在 post 节点上存储纬度和经度。
实际模型更多地取决于您的用例。
是的,最喜欢/喜欢的是一段感情。
我们将把 NEO4J 用于我们的社交网络数据库,我们有常见的社交网络操作,例如关注、link、评论、posts 等等...。
现在我想知道这是否正确,我们正在做:
Comment: user_comment is a node and has a relation with post node, relation name is comment
Like: Like is a relation, the relation name is like and a post has a relation with a user, the relation name is like
Location: Each post can have a location, then post node has a where relation with location node. (We use Google map API for locations)
tags: Each can have some tags, if tag is exist as a node we just define a relation to tag, then post node has tag relation with tag node
media: media node has media relation with post node
好的,请告诉我以上定义和关系是否正确,或者我们可以做其他事情吗?
例如,点赞操作(收藏)是否应该是用户与 post 之间的关系?或者我们可以做点别的?等等上面的其他节点...
听起来很合理。
您还可以选择仅在 post 节点上存储纬度和经度。
实际模型更多地取决于您的用例。
是的,最喜欢/喜欢的是一段感情。