I am using PHP to make an instant chat room, want to store the content of the chat in a TXT file, the client each request content first to determine whether the TXT file size has changed, there is a change in the description of the new information, and then the PHP processing to return the new information to the client.
Does this compare with the storage in the database will be compared to the consumption of performance, or find the content is relatively slow? How big is the impact?
I would like to store the content in a file to delete the chat when the chat is over. Excuse me, what is the better plan?
Reply to discussion (solution)
In fact, the data exist in the database, there will not be too much consumption.
In fact, the data exist in the database, there will not be too much consumption.
。。。 Yes, I'm asking if there's a file that's going to cost a lot more than the existence of a database.
If you are considering performance issues
Then the professionals will do better than the average person.
Or there's no CEO business.
If you are considering performance issues
Then the professionals will do better than the average person.
Or there's no CEO business.
I may not say very clearly, my current needs are:
(1) Fast to find new chat content
(2) After the chat to delete the chat content, or do not need to save chat content.
Would this be a good place to save the chat to a file or to a database?
This is just a PHP problem, not the CEO to answer the question it ...
You don't understand a metaphor?
Without a test, I don't have a say. If the data is very small, direct txt faster if it's a little bit more, there's no database.
You don't understand a metaphor?
Soga ...
Without a test, I don't have a say. If the data is very small, direct txt faster if it's a little bit more, there's no database.
Haha, this speech is very helpful, but also want to know more detailed comparison.
For example, there are a number of different topics in the chat room, it is good to build multiple tables or multiple TXT files. In addition, you still have to delete the table or TXT file after the chat is over. Is this a good way to build a table or a TXT file?
can use Memcache, the instant information does not need to deposit the database.