"Mike" wrote:
> thaks for the reply.  I conducted a simple/rough benchmark to which is
more
> expensive.
...

> On the win box, file system access was 11 times faster, while on the
freeBSD
> box, file system access was 3 times faster.  The include of the adodb
class
> is not benchmarked, as part of this test, that that adds extra overhead as
> well.
>
> I suppose that filesystem access is faster.

The answer that you got that said "it depends", while superficially not very
useful is almost certainly right.

Compared to a 'select * from table' query, reading all of a file is likely
quicker regardless of which DB or DB abstraction you use.

How about some more complex cases:

 * 'select * from table where id = 999' compared to reading in a file and
finding the correct line?

 * inserting or altering a line in the middle of an ordered file, compared
to a simple insert or alter on a DB?

 * writing data to the file while 40 other script instances are all trying
to read and write to the file at the same time and doing your own
concurrency control, compared to letting a DB engine handle the concurrency
issues for you?

Simple tasks might be easier and quicker to do from a file, in which case,
if the application is unlikely to grow or evolve, the file might be the best
way to do things.  For complex or concurrent tasks, it can be much more
efficient in terms of both programming and execution time to let the DB
handle some of the harder parts for you.

It really does depend exactly what you are trying to do with your database
or file.

Cheers,

Luke Welling
--
PHP and MySQL Web Development
by Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842/tangledwebdesign




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to