Php message push-How php website message push works

Source: Internet
Author: User
Tags php website
Main information: the user management system is intended for registration. My admin table and user table are separated. Problem: Problem 1: the admin (website administrator) can specify a user to push messages or push messages to all users, you can also push messages to users whose registration invitation code is... main information: it is intended to be a user management system. Invite Registration. My Admin table and user tableIs separated.

Problems:
Question 1: The admin (website administrator) can specify a user to push messages, or push messages to all users, or push messages to users whose registration invitation code is.
Question 2: I can register with you through my invitation codeUser GroupTo push messages, you can also registerUserPush messages.

My idea is:
Idea 1: create a message table. When I send a message to a user group, I find all the IDs and write them into the table, when querying at the front-end, check whether the table has the id of the user. If yes, it is displayed. However, I think this idea is unreasonable. If there are 1000 users on the website, writing is time-consuming, and the user interface is time-consuming for reading. In addition, you cannot determine whether the user is read or unread. In this way, a data corresponds to multiple IDs.
Idea 2: resume a message table. When I send messages to a user group, I find all the IDs and insert these IDs into this table cyclically. In this way, the user is read or unread, because each id corresponds to a piece of data. However, if my website has 10000 members, if I push a piece of data every day and other users send messages for a long time, the table will have hundreds of thousands or millions of data records, sooner or later, the database will be dragged to death. This is not the best way.

I hope you can give me a better idea if you have such knowledge. Thank you.

Reply content:

Main information: it is intended to be a user management system.Invite Registration. MyAdmin table and user tableIs separated.

Problems:
Question 1: The admin (website administrator) can specify a user to push messages, or push messages to all users, or push messages to users whose registration invitation code is.
Question 2: I can register with you through my invitation codeUser GroupTo push messages, you can also registerUserPush messages.

My idea is:
Idea 1: create a message table. When I send a message to a user group, I find all the IDs and write them into the table, when querying at the front-end, check whether the table has the id of the user. If yes, it is displayed. However, I think this idea is unreasonable. If there are 1000 users on the website, writing is time-consuming, and the user interface is time-consuming for reading. In addition, you cannot determine whether the user is read or unread. In this way, a data corresponds to multiple IDs.
Idea 2: resume a message table. When I send messages to a user group, I find all the IDs and insert these IDs into this table cyclically. In this way, the user is read or unread, because each id corresponds to a piece of data. However, if my website has 10000 members, if I push a piece of data every day and other users send messages for a long time, the table will have hundreds of thousands or millions of data records, sooner or later, the database will be dragged to death. This is not the best way.

I hope you can give me a better idea if you have such knowledge. Thank you.

Http://www.workerman.net/web-sender

For message pushing, see 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.