Jump to content

How can I ensure that a text file being accessed and updated by numerous people doesn't become corrupt?


Recommended Posts

I'm thinking of creating a  text file of a database to be used instead of multiple queries.


This idea isn't mine originally, just thought it could be a better option


First: Let's say we have a 1000 users


What is better:


1) A text file to be accessed 1000 times, being broken up for the parts eg. user, text posted, date, etc...

2) The same data in the database accessed 1000 times but faster search


or are they pretty much the same thing? data stored somewhere

My concern... so far my thought of action is that every time a page that uses this text file is loaded, the current text file is loaded and then the same text file is updated.

Meanwhile, if people write to the file, it can be updated as well while it is being used, I would think I should have at least two, but then I would think that's not enough, this could become a lot... so what plan should I go down?


Is this a silly concern?

What is the better way to solve this problem of a database being displayed and updated. Seems like an everyday thing. Just wondering the savings from using a text file or just use the database.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.