Main information: Intended to do user management system, is
Invitation RegistrationOf It's mine
Admin table and user tableare separate.
Problems encountered:
Issue One: admin (webmaster) can specify the user push message, can also push the message to all users, or to the registration invitation code is # # # #的用户推送消息.
Question two: I can push a message to a user group registered with my invite code, or I can push a message to a user who is registered through my invitation code.
My idea is:
Idea one: Build a message table, I send a message to the user group at the time to find out all the ID, and then write to the table, in the foreground query when the table has the user ID, if there are words to show, but feel I think this idea is unreasonable, if the site has 1000 users, write time is too time-consuming, The user interface is also time-consuming to read, and there is no way to tell if the user is read or unread, so that the data corresponds to multiple IDs.
Idea two: Resume a message table, I will send a message to the user group to find out all the ID, and then the ID loop inserted into the table. This solves the problem of whether the user is read or unread, because each ID corresponds to a single piece of data. But suppose my site has 10,000 members, if I push a piece of data every day, other users send messages, time is long, the table will have hundreds of thousands of or millions of data, sooner or later will be dragged to death database. Feeling is not the best way.
Hope to have this knowledge can give a better idea, thank you.
Reply content:
Main information: Intended to do user management system, is the invitation to register . My admin table and User table are separate.
Problems encountered:
Issue One: admin (webmaster) can specify the user push message, can also push the message to all users, or to the registration invitation code is # # # #的用户推送消息.
Question two: I can push a message to a user group registered with my invite code, or I can push a message to a user who is registered through my invitation code.
My idea is:
Idea one: Build a message table, I send a message to the user group at the time to find out all the ID, and then write to the table, in the foreground query when the table has the user ID, if there are words to show, but feel I think this idea is unreasonable, if the site has 1000 users, write time is too time-consuming, The user interface is also time-consuming to read, and there is no way to tell if the user is read or unread, so that the data corresponds to multiple IDs.
Idea two: Resume a message table, I will send a message to the user group to find out all the ID, and then the ID loop inserted into the table. This solves the problem of whether the user is read or unread, because each ID corresponds to a single piece of data. But suppose my site has 10,000 members, if I push a piece of data every day, other users send messages, time is long, the table will have hundreds of thousands of or millions of data, sooner or later will be dragged to death database. Feeling is not the best way.
Hope to have this knowledge can give a better idea, thank you.
Http://www.workerman.net/web-sender
To do the message push, you can look at this