Skip to content

comments, likes, posts, notifications and messages two way reference is not needed #185

@kamalyusuf

Description

@kamalyusuf

What version of Node.js are you using?

v14.17.5

What version of Yarn are you using?

1.22.15

What browser are you using?

chrome

What operating system are you using?

windows

Describe the Bug

Since the corresponding models already exist and you can just query the collection to retrieve a user's respective data, this 2 way reference is not needed and will not scale. Mongodb documents have a size limit of 16mb, if a user has thousands of likes, posts, etc... then everything is gonna break. Also, another downside is sending unnecessary large amount of json data when the user is being queried if only the full name is needed for example.

Applies to following and followers as well.

Expected Behavior

User model should be scalable

Steps to reproduce

Create a popular social network

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions