Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kamalyusuf opened this issue Dec 13, 2021 · 1 comment

Comments

@kamalyusuf
Copy link

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

@DimiMikadze
Copy link
Owner

Hi @kamalyusuf, thanks for your information. I have difficulty understanding why everything will break if there are thousands of posts or likes.

I understand that the current database architecture is not perfect, but I don't think it will have problems on a smaller scale.

However, if you can provide detailed information about the problem and the solution you are thinking of. Then, I'd be glad to discuss it with you and finally merge your PR. If it's just a theoretical issue and you are not going to work on it, let's close it because we already have a similar one that nobody is working on: #181

In general, if somebody will be using Orca on millions of user scale, I'll be expecting their contribution to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants