Which would be better? Storing/access data in a local text file, or in a database?

Posted by TerranRich on Stack Overflow See other posts from Stack Overflow or by TerranRich
Published on 2010-05-15T05:56:56Z Indexed on 2010/05/15 6:04 UTC
Read the original article Hit count: 209

Filed under:
|
|
|
|

Basically, I'm still working on a puzzle-related website (micro-site really), and I'm making a tool that lets you input a word pattern (e.g. "r??n") and get all the matching words (in this case: rain, rein, ruin, etc.). Should I store the words in local text files (such as words5.txt, which would have a return-delimited list of 5-letter words), or in a database (such as the table Words5, which would again store 5-letter words)?

I'm looking at the problem in terms of data retrieval speeds and CPU server load. I could definitely try it both ways and record the times taken for several runs with both methods, but I'd rather hear it from people who might have had experience with this.

Which method is generally better overall?

© Stack Overflow or respective owner

Related posts about database

Related posts about localstorage