Replies: 1 comment 1 reply
-
|
@woodjs I don't think using a nested set for the users table is a good idea. Nested set is fast when you read the tree, but is slow when you add/remove data. Each inserting/removing of a row produces updates of all other entries in the tree. Imagine, you have 9k users. A new user is signing up. You need to update 9k rows. It will be slow for every new user. I think a relation of user_id and parent_id is enough for your use case:
sequelize-hierarchy.js uses |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The user can have an unlimited number of referrals. And also you need to often get the structure of trees and work with them.
The number of users can reach up to 10,000.
I am also considering an option: https://github.com/overlookmotel/sequelize-hierarchy. Can you suggest which solution is best for my task?
Beta Was this translation helpful? Give feedback.
All reactions