[ad_1]
I’m building some MLM member system with Node and MySQL. Which relation like this
UserId | UplineId |
---|---|
A | null |
B | A |
C | B |
D | B |
E | D |
If I am User A, after login system will cache some data from MySQL into Redis like this
- USER_A_DOWNLINE => [[B],[C,D],[E]]
- USER_A_TOTAL_INCOME => 1000 (Summary of all downline user’s income)
The problem is if there is new user under User E. How can I delete all data that related to User E (USER_A_DOWNLINE and USER_A_TOTAL_INCOME in this case) ?
[ad_2]