RE: [PHP] MySQL vs. basic text file
| From: | David Buerer | Date: | Mon, 23 Sep 2002 15:51:03 +0000 |
| Subject: | RE: [PHP] MySQL vs. basic text file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117299@lists.php.net to get a copy of this message | ||
Speed
Accessability
Features
Security
Performance
Simplicity
Reusability
Indexing
Record-Locking
To name a few.
however, in your situation, it's an existing application which is working
great and which no one has any complaints over. If it ain't broke, don't
fix it.
For your next application, use a database. When it's time for a major
upgrade to this one, convert, until then, just leave things the way they
are.
Let me illustrate a point on the performance/simplicity front. let's say
that you need to change the title of an item in a catalog.
With a text file:
1.) Open the file
2.) Read the contents of the file until you find the item you're looking for
(got help us if it's the last item!)
3.) Parse the line
4.) rewrite the line with the new information
5.) rewrite the file
6.) Close the file
ellapsed time: depending on the speed of the computer, typically between 1-5
seconds
With a database
1.) Open the database
2.) UPDATE catalog SET title='new title' WHERE item=123
ellapsed time: < 1 second, my benchmarks show usually in the .26-.33 second
range
-----Original Message-----
From: Doug Parker [mailto:drparker@clam.rutgers.edu]
Sent: Saturday, September 21, 2002 4:26 PM
To: php-general@lists.php.net
Subject: [PHP] MySQL vs. basic text file
often i use text files at my data sources, delimted by the "|" symbol.
i simply delimit the fields of each line, then when i need to open them,
i open the text file, populate an array with each line, then explode the
fields for each to get the corresponding values. i use this method for
catalogs - and even backend interfaces, for which the client can
add/edit/delete products. everything seems to be working fine, and
there doesn't seem to be a need for MySQL or anything. i was wondering
if there is anything i'm not thinking of that perhaps would push me to
favor using php and mysql instead of the plain old text file.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php