How can memcached-php better implement image and text live broadcast?

Source: Internet
Author: User
The requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages. My idea is that every time I send a live message, I use the message id as the key to add an m... the requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages.

The idea is that each time a live message is sent, the message id is used as the key to add a memcache record, and a message id list is maintained and put into memcache. When a user requests a message, the incoming message id takes n IDs forward based on the message id list, and n records are retrieved from memcache for n times and returned. If an error occurs during the process, read the database to regenerate the cache.

Q: Is this feasible? Can it meet requirements? Is there a better solution?

Reply content:

The requirement is to implement a graphic and text Live Broadcast System. when sending live messages, users can refresh in real time and meet sufficient requirements (1 w) and can view historical messages.

The idea is that each time a live message is sent, the message id is used as the key to add a memcache record, and a message id list is maintained and put into memcache. When a user requests a message, the incoming message id takes n IDs forward based on the message id list, and n records are retrieved from memcache for n times and returned. If an error occurs during the process, read the database to regenerate the cache.

Q: Is this feasible? Can it meet requirements? Is there a better solution?

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.