in reply to Which is quicker - writing to a file or inserting into a db?

Oh, assuming the actual disk speed is the same; well let's assume the database is on the same machine and writes to the same disk, I would guess that appending to a file is much quicker than inserting a record in the database.

All bets are off once you need to check against existing records (basically starting when you need to see if an email has already been registered). For simple cases, it's still relatively trivial to beat mysql, but you're going to have to build a lot more infrastructure yourself, or use some simpler, faster (probably non-relational) database system, like BerkelyDB.

update: you are already using mod_perl or some other persistent processing system, right? otherwise there's really not much point in even thinking about this.

  • Comment on Re: Which is quicker - writing to a file or inserting into a db?