gpt4 book ai didi

database-design - 如何在 NEO4J 中存储社交网络的 Action ?

转载 作者:搜寻专家 更新时间:2023-10-30 23:39:09 24 4
gpt4 key购买 nike

我们将把 NEO4J 用于我们的社交网络数据库,我们有常见的社交网络操作,例如关注、链接、评论、发帖等......

现在我想知道这是否正确,我们正在做:

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

好的,请告诉我以上定义和关系是否正确,或者我们可以做其他事情吗?

例如,点赞 Action (收藏)是否应该是用户和帖子之间的关系?或者我们可以做点别的?等等上面的其他节点......

最佳答案

听起来很明智。

您还可以选择仅在帖子节点上存储纬度和经度。

实际模型更多地取决于您的用例。

是的,最喜欢/喜欢的是一种关系。

关于database-design - 如何在 NEO4J 中存储社交网络的 Action ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37374675/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com