Storage of php chat room information

Source: Internet
Author: User
I am using php to create an instant chat room. I want to store the chat content in a txt file. each time the client requests the content, I first determine whether the size of the txt file has changed, if there is any change, a new information is displayed. after php processes the change, it returns the new information to the client.
Will this process consume performance or query the content slowly compared with that stored in the database? What is the impact?
I want to save the content to a file to delete all the chat content when the chat ends. Which solution is better in this case?


Reply to discussion (solution)

In fact, the data is stored in the database, and it will not consume much.

In fact, the data is stored in the database, and it will not consume much.
... I am asking if there are files that consume much performance than databases.

If you want to consider performance issues
Then professionals will certainly do better than ordinary people.
Otherwise, the CEO will be absent.

If you want to consider performance issues
Then professionals will certainly do better than ordinary people.
Otherwise, the CEO will be absent.
What I may not be very clear about is:
(1) fast search for new chat content
(2) delete the chat content after the chat ends, or do not need to save the chat content.
In this case, can I save the chat content to a file or to a database?
This is just a simple php question, not a question answered by the ceo...

For example, do you not understand?

If there is no test, there is no right to speak. let me talk about my feeling about this commodity. if the data is very small, the txt will be faster. if it is a little more, it is estimated that there will be no database faster.

For example, do you not understand?
Soga...

If there is no test, there is no right to speak. let me talk about my feeling about this commodity. if the data is very small, the txt will be faster. if it is a little more, it is estimated that there will be no database faster.
Haha, this speech is very helpful, but I still want to know more details.
For example, if there are multiple chat rooms with different topics at the same time, whether to create multiple tables or multiple txt files is good. In addition, you still need to delete the table or txt file after the chat ends. In this case, the table is created or the txt file is created.

You can use memcache to store real-time information in the database.

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.