Ask a question about how the chat record should be stored
The background is this: a Web chat program, one of the main function is the real-time chat on both sides of the online, but this chat record will not be saved, but in the chat between the two sides, that is, the chat window is not closed before the temporary storage of chat records, my preliminary design is temporarily save the latest 300 records.
So the question is: What's the best way to save up to 300 temporary chats, where I saved them? is the temporary file stored locally, or stored in the front-end JS memory, or build a MySQL data table, constantly insert,delete,update? Or is it stored in the memory of the MC and the session? Or are there other better options?
Please note that this chat record only when the chat window is not closed, temporarily to display the content of the current chat, when the chat window is closed or quit chatting, the chat record is not used.
Share to:
------Solution--------------------
A private conversation?
exist that all can
1, the existence of JS, cookies, session of the problem is that both sides to save
2. The problem with Memcache is the need for third-party software
3, the existence of files, the problem is that the total number of one-to-one, will likely cause file system management problems
3, the existence of the database should be the first choice, besides MySQL memory table, very high speed