The following are simplified Data and Scenario Data User information: User ID [ID], user NAME [NAME] user relationship: user ID1 [UID1], user ID2 [UID2], LABEL [LABEL] user status: User ID [UID],... the following are simplified data and scenarios:
============================================================ ==============
-
User information:
User ID [ID] and user NAME [NAME]
-
User relationship:
User ID1 [UID1], user ID2 [UID2], LABEL [LABEL]
-
User status:
User ID [UID], CONTENT [CONTENT]
======================================================= ==============
-
Assume that three users exist.
ID | NAME
1 |
2 | B
3 | C
-
Mutual Relationship:
UID1 | UID2 | LABEL
1 | 2 | relative
2 | 3 | colleague
-
Scenario:
A. Publish A status.
UID | CONTENT
1 | hello world !!
======================================================= ================
C can see the release status of A, and know that this status is released by colleague B's relative.
========================================================= ================
What is the simplest and easiest way to understand the minimum pressure on the system ????
=================================================== ==========
Currently, I have two solutions.
1. Only one status is recorded. Users who follow two dimensions can query this status through the link.
Advantage: simple logic
Disadvantage: system pressure exponential growth
2. Record the redundancy status. When a user publishes a status, all users with two-dimensional attention record a status.
Advantage: low system pressure
Disadvantage: large data redundancy
Reply content:
The following are simplified data and scenarios:
============================================================ ==============
-
User information:
User ID [ID] and user NAME [NAME]
-
User relationship:
User ID1 [UID1], user ID2 [UID2], LABEL [LABEL]
-
User status:
User ID [UID], CONTENT [CONTENT]
======================================================= ==============
-
Assume that three users exist.
ID | NAME
1 |
2 | B
3 | C
-
Mutual Relationship:
UID1 | UID2 | LABEL
1 | 2 | relative
2 | 3 | colleague
-
Scenario:
A. Publish A status.
UID | CONTENT
1 | hello world !!
======================================================= ================
C can see the release status of A, and know that this status is released by colleague B's relative.
========================================================= ================
What is the simplest and easiest way to understand the minimum pressure on the system ????
=================================================== ==========
Currently, I have two solutions.
1. Only one status is recorded. Users who follow two dimensions can query this status through the link.
Advantage: simple logic
Disadvantage: system pressure exponential growth
2. Record the redundancy status. When a user publishes a status, all users with two-dimensional attention record a status.
Advantage: low system pressure
Disadvantage: large data redundancy
First, because memcache redis and the second solution can be used during user growth.
Is it okay to redundant an ID. In addition, I think redundancy can be easily divided into two layers: relationship, relationship Content ID, and relationship Content ID. Of course, you can also consider this directly redundant content.
The read permission Code made by the circle of friends is non-redundant. It is calculated when the code is directly read. This is because it needs to be dynamically adjusted based on whether it is a friend or not.