GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Advance PHP prog. I need an advice. (https://gfy.com/showthread.php?t=433847)

qw12er 02-19-2005 08:51 AM

Advance PHP prog. I need an advice.
 
Will it be faster to dump data into a file than in a Database ?

Thanks

psili 02-19-2005 08:56 AM

I'd think a DB would be faster since it supports multiple connections where as a file you have to deal with I/O resource constraints.

Spudstr 02-19-2005 08:57 AM

flat file would be faster, even though your still using multi connections your still using a wrapper to get to the database. still using a wrapper to use the file... i sitll think flat file will be faster

MickeyG 02-19-2005 08:59 AM

i believe its faster to write to but not read from.

qw12er 02-19-2005 09:05 AM

I'd say flat file would be faster ... but I never saw benchmark ... anybody have a URL ?

Spudstr 02-19-2005 09:08 AM

file is faster to write/read from.. just don't go searching through it ;-)

qw12er 02-19-2005 09:11 AM

HAHAHAHA Don't worry I'm not such a dumb ass :)

woj 02-19-2005 09:13 AM

It's not hard to do your own benchmark, just loop through 1000s of inserts to a flat file and then database (probably open and close connection between each write). It's not exactly accurate, but will give you a rough idea.

psili 02-19-2005 09:14 AM

Since everyone is saying the file - what happens if it's a high transaction load and you have to maintain locks on the file to ensure data integrity; wouldn't you hit a open / write / close limit as opposed to a database that can handle multiple at the same time ?

Seriously, I'd like to know as well.

onlyreal 02-19-2005 09:17 AM

as long as you dont search

files

but for example password username matching is also searching

one more thing moving in files s always hard pointers etc db rulez

Calvinguy 02-19-2005 09:17 AM

DB access is always faster than a flatfile. Especially if you use the querycache function in mysql 4+

Spudstr 02-19-2005 09:24 AM

well he asked if it would be faster to dump data to a file or a db.. DUMp keyword :) if your reading it over and over.. db is the way to go.. just depends on what he's trying to do..

qw12er 02-19-2005 09:36 AM

I just thougt - How can the DB be faster ?

Database will ultimately result into a write command to a flat file + all the operations to connect and interprate the command. So all the writting operation + some other...

So it's quite sure files are faster ... the question now is will writting to files result in a file lock situation resulting into lag time ?

A good way to avoid this would be to create a file everytime ... but I'm not sure this is the way to go ... Cause my system won't work in real time and I'll have to use a cron table to update my database everyday ...

psili 02-19-2005 09:45 AM

I was only thinking of this in terms of transaction load: Access to a file can only happen with one connection (write) at a time, but a DB can handle multiple connections (writes) at the same time as it's threaded. It's Saturday morning though, so I could be retarded and am thinking of this entirely wrong.


All times are GMT -7. The time now is 04:17 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123