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
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.
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 ?
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..
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 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.
Comment