Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-19-2005, 08:51 AM   #1
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
Advance PHP prog. I need an advice.

Will it be faster to dump data into a file than in a Database ?

Thanks
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 08:56 AM   #2
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 08:57 AM   #3
Spudstr
Confirmed User
 
Spudstr's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: In a Tater Patch
Posts: 2,321
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
__________________
Managed Hosting - Colocation - Network Services
Yellow Fiber Networks
icq: 19876563

Last edited by Spudstr; 02-19-2005 at 08:59 AM..
Spudstr is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 08:59 AM   #4
MickeyG
Confirmed User
 
Join Date: May 2004
Location: South Florida
Posts: 4,134
i believe its faster to write to but not read from.
MickeyG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:05 AM   #5
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
I'd say flat file would be faster ... but I never saw benchmark ... anybody have a URL ?
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:08 AM   #6
Spudstr
Confirmed User
 
Spudstr's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: In a Tater Patch
Posts: 2,321
file is faster to write/read from.. just don't go searching through it ;-)
__________________
Managed Hosting - Colocation - Network Services
Yellow Fiber Networks
icq: 19876563
Spudstr is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:11 AM   #7
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
HAHAHAHA Don't worry I'm not such a dumb ass
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:13 AM   #8
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
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.
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:14 AM   #9
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:17 AM   #10
onlyreal
Confirmed User
 
Join Date: Jun 2001
Posts: 853
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
onlyreal is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:17 AM   #11
Calvinguy
Confirmed User
 
Join Date: Oct 2002
Location: European Union
Posts: 1,752
DB access is always faster than a flatfile. Especially if you use the querycache function in mysql 4+
Calvinguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:24 AM   #12
Spudstr
Confirmed User
 
Spudstr's Avatar
 
Industry Role:
Join Date: Jan 2003
Location: In a Tater Patch
Posts: 2,321
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..
__________________
Managed Hosting - Colocation - Network Services
Yellow Fiber Networks
icq: 19876563
Spudstr is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:36 AM   #13
qw12er
Confirmed User
 
Join Date: Apr 2004
Location: Montreal
Posts: 799
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 ...
__________________
I have nothing to advertise ... yet.
qw12er is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-19-2005, 09:45 AM   #14
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
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.
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.