![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: May 2004
Location: South Florida
Posts: 4,134
|
i believe its faster to write to but not read from.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
<&(©¿©)&>
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
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+
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
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
![]()
__________________
Managed Hosting - Colocation - Network Services Yellow Fiber Networks icq: 19876563 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |