SquidCombo Posted March 19, 2007 Share Posted March 19, 2007 Hi guys, I need help, which one would be the better choice if I want to keep CPU Load and bandwidth usage to the minimum? Although I'm going to use PHP for this, I think it applies to any web programming language. Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/ Share on other sites More sharing options...
Dice7 Posted March 19, 2007 Share Posted March 19, 2007 hmmm... well not knowing what your really doing with this and how much info you have. I would think DB.. Dice :mellow: Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-327498 Share on other sites More sharing options...
SquidCombo Posted March 19, 2007 Author Share Posted March 19, 2007 What I want to do is for a user to be able to search for a log using some sort of a log code. So I can do either: 1. When a user enters the code to search, a hash function would convert the code so that the result would point to the corresponding file and the display page would parse the text in the file. or 2. Have the logs in the database, so when the user enters the code to search, the display page would query the database and look for the corresponding log. The database returns the log. Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-327571 Share on other sites More sharing options...
Dice7 Posted March 20, 2007 Share Posted March 20, 2007 So you want like a document manager? There are many tools out there for that. but if you want to build it I would think a db would be the best. I think it would be easier to manage as well. Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-328073 Share on other sites More sharing options...
lord_muad_dib Posted March 20, 2007 Share Posted March 20, 2007 writing/fetching data directly from a file is slower and(depending on the site traffic) leads to problems its better to use a db, designed for multi accesses per time. Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-328312 Share on other sites More sharing options...
SquidCombo Posted March 23, 2007 Author Share Posted March 23, 2007 I have to keep track of 1000 logs and the logs are frequently updated (one entry every minute). Would it be better to write the logs in separate xml files and then retrieve them according to the xml filename or writing the logs to the database is still faster. I'm just afraid that the database entries would be too big. Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-330311 Share on other sites More sharing options...
emig647 Posted April 5, 2007 Share Posted April 5, 2007 Database hands down. All the data is indexed and quickly accessed. There are very rare instances to ever use text files... I started to type one, but nope that one would be better in a db too Link to comment https://www.insanelymac.com/forum/topic/45769-retrieve-text-from-files-vs-database/#findComment-340851 Share on other sites More sharing options...
Recommended Posts