PHP message Push-PHP website message push principle Consult

Source: Internet
Author: User
Tags php website
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.