there is a requirement:
A notice is sent to specify who can read it.
the simplest solution to take advantage of mysql:
message Information Table
id Information ID
name
content
message_user user View Information Table
id
message_id Information ID
user_id user ID
tell me about the method
advantages:
easy to implement
disadvantages:
for example, an article is assigned to 10, 000 people and thousands of articles are posted.
the message_user table will soon have a burst of information and will soon have a performance bottleneck.
therefore, please give us a more efficient solution, third-party storage is unlimited.
there is an assumption that each bit in binary is used to represent a user ID,. A value of 1 indicates read permission, while 0 has no permission:
message information table, add a column of binary (10000) binary type suppose to be user_control
user ID 1 is readable, 2 unreadable, 3, readable, .1000 readable
then the binary number corresponding to user_control is
1. . 1010
I don"t know if it"s feasible?