How can I store chat records?

Source: Internet
Author: User
Ask a question about how to store chat records. The background is as follows: a WEB chat program. one of the main functions is the real-time chat between the two parties online, however, this chat record will not be saved in the end. it is stored temporarily when both parties chat, that is, before the chat window is closed, my preliminary design is to temporarily save the latest 300 records. The question is: how to store chat records?
The background is as follows: one of the main functions of a WEB chat program is the real-time chat between the two parties online. However, this chat record will not be saved in the end, but when both parties chat, that is, before the chat window is closed, I temporarily save the chat record. my preliminary design is to temporarily save the latest 300 records.

So the question is: where can I save up to 300 temporary chat records? how can I save them? Are temporary files stored locally, in front-end JS memory, or a MYSQL data table created to continually insert, delete, and update data? Or stored in memory such as MC and SESSION? Or are there other better solutions?

Note that this chat record temporarily displays the content of the current chat only when the chat window is not closed. after the chat window is closed or exited, this chat record is no longer needed. Share:
------ Solution --------------------
Private chat?
Yes
1. the problem with js, cookie, and session is that both parties need to save
2. the problem with Memcache lies in the need for third-party software.
3. there are files. The problem is that there are always one-to-one files, which may cause file system management problems.
3. databases should be the first choice. besides, mysql memory tables provide extremely high speeds.

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.