ASP, CGI and PHP Scripts and Record-Locking: What Every Webmaster Needs To Know - They can store...
(Page 4 of 7 )
1. They can store each bit of data in a separate file. This isn't
necessarily a total solution by itself (in particular, a script
which just does this could still have problems if multiple copies
of a script update the same file at the same time), but it does
make data corruption less likely, and if corruption does occur,
at least it won't corrupt the entire data store in one go.
2. They can use file-locking. This means that if one copy of a
script is working with a file, another copy of the script is
prevented from working on that file, until the first copy has
finished. File-locking works if done correctly, but programming
it into a script needs to be done very carefully and precisely,
for every single possible case... even a tiny bug or omission can
allow the possibility of data-corruption in through the backdoor!
3. They can use a database (such as MySQL) to store the data.
Provided the data is properly structured in the database, the
database handles the locking automatically. And, as the
programmer doesn't have to write their own special locking
routines, the possibility of bugs and omissions are much reduced.
Of course, avoiding having your data corrupted should be the
paramount consideration in choosing a script, but is there
anything else we need to be concerned about?
More Website Content Articles
More By Jase Dow