Portal Home > Knowledgebase > Articles Database > mySQL vs flatfiles


mySQL vs flatfiles




Posted by zoobie, 07-18-2008, 09:43 PM
I'm thinking about switching from a mySQL bulletin board to a flat file one. Are there any security issues with flatfiles I should know about or is this up to the coders of the board? Thx

Posted by CodyRo, 07-18-2008, 09:48 PM
Stick with MySQL.. a flat file based board will be dreadfully slow if it has any activity.. not to mention the functionality will be lacking. As for security I suppose it's easier to manipulate / tamper with - but for performance sake stick with MySQL.

Posted by zoobie, 07-18-2008, 09:59 PM
There's no/little activity on the board. I find the rest fluff so I'm looking for something simple and free like my UPB. Thx

Posted by freewebspace, 07-18-2008, 10:03 PM
I am using flatfiles to store indexed websites whether it will have any performance issues because I have more than 1,000,000 flat files in a folder...

Posted by zoobie, 07-19-2008, 03:53 PM
interesting... I also thought flatfiles were faster than any db could ever dream of being

Posted by The Universes, 07-19-2008, 09:35 PM
Try search, you can't search flat files as fast as a mysql db, which is a useful feature for forums.

Posted by SimonT, 07-19-2008, 09:58 PM
I moved from a flat file to DB years agao i kept finding that my flat file received corrupted data and as soon as my site started getting larger amount of hits it was just better to change to a MYSQL database for speed and performance.

Posted by CodyRo, 07-19-2008, 11:03 PM
Not in the slightest.. maybe if you were serving up static content. I'm not sure what you're saying, but a million files itself would cause issues most likely.. care to elaborate what you mean?

Posted by zoobie, 07-19-2008, 11:29 PM
the reason I asked about the security issues with both is the fact that my site has been attacked twice...which is weird because it's a reference site...and I read that the db is the weakest link on any website...but I guess it's up to the coders to determine the security of injections, flooding, etc (I'm using phpBB now...) my understanding is that by using flat/text files, there is no backend that punks can get into Thx

Posted by sc_freak, 07-19-2008, 11:34 PM
You can't be serious, you want to switch to a flat file forum because right now your forum isn't secure?

Posted by zoobie, 07-19-2008, 11:58 PM
I may get rid of it altogether...but it's got an image gallery mod attached to it. Whatever I decide, it's going to take some work. Just exploring some options. Guests need to somehow post their events and news. Nobody really posts. The image gallery can easily be replaced with times 450...another PITA Last edited by zoobie; 07-20-2008 at 12:03 AM.

Posted by MziB, 07-20-2008, 03:06 PM
Mysql is a lot better than flat files, with flat files your HD might catch on fire if your site is modest size.

Posted by vibrokatana, 07-20-2008, 04:07 PM
flat files (like sqlite) tend to perform faster so long as only one process is accessing it. However you are more prone to corruption and degraded performance in multi-access applications (which most websites are). Is this sarcasm? I think you broke my detector... Hardware generally will not burst into flames unless you are doing something really stupid, like pouring in lighter fluid. The most I have seen was a power supply give out a bit of smoke when it decided it had enough.

Posted by hzDylan, 07-20-2008, 04:28 PM
When we're talking hundreds of thousands of flat-files versus a single mySQL database with hundreds of thousands of tables - mySQL will out perform flat-files. This is why MySQL was developed and is why most CMS' these days use mySQL. With mySQL you're able to reference specific table ID's, specify a "select from where" - when you're dealing with flat-files, you'll need to read each and every file, most times having to read an entire flat-file to determine it's data. A simple example would be to "ls" (list) a directory in UNIX which contains 5,000+ flat-files - you'll notice an obvious delay. Now pick a database and do a "mysql -e 'show tables;' - there's an obvious speedup. Having a script perform common listings, searches and/or file manipulations by multiple visitors/requests will obviously become an issue in the long-run compared to a cached mySQL database.

Posted by zoobie, 07-20-2008, 08:19 PM
thanks all...I'll stick with mySQL and a secure bulletin board



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Are you making enough? (Views: 502)
solusvm virtualization (Views: 526)