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.