lalabored Posted May 25, 2007 Share Posted May 25, 2007 Is it okay to not use MySql and just use flat file databases to power a user management thing? I don't have any problems using flat file databases and I was just wondering if there are any major disadvantages. Do all large sites use MySql databases and is there actually any large site that uses flat files? Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/ Share on other sites More sharing options...
corbin Posted May 25, 2007 Share Posted May 25, 2007 To be honest, I've never heard of any site over a thousand people using flat file. With flat files, you must load/read the entire file.... If the file grows to 10MB what are you going to do if you start getting substantial amounts of hits? (At 10MB it doesn't take many hits ;p) Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-261854 Share on other sites More sharing options...
trq Posted May 26, 2007 Share Posted May 26, 2007 Flat files are allot more work to deal with... you can't easily query them for specific information for instance. Unless of course your talking about sqlite, this is a flat file db system which uses the sql language to query data. Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-261907 Share on other sites More sharing options...
lalabored Posted May 27, 2007 Author Share Posted May 27, 2007 But is there any extremely large disadvantages? If a MySql database has a lot of information, won't it load slowly as well? Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-262833 Share on other sites More sharing options...
The Bat Posted May 27, 2007 Share Posted May 27, 2007 But is there any extremely large disadvantages? If a MySql database has a lot of information, won't it load slowly as well? Not necessarily. If you use a RDMS, and you only need to call rows with a certain condition (like this) mysql_query("SELECT * FROM mytable WHERE myfield = 'something'"); and if it returns, say, 3 rows - that will take no time at all. However, when using a flat file, you'd need to load the whole file first before calling whatever information. Plus, it is extremely easy to work with MySQL in PHP. Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-262859 Share on other sites More sharing options...
utexas_pjm Posted May 27, 2007 Share Posted May 27, 2007 One of many important things that an RDBMS like MySQL provides is the use of indexes. As the data stored in a flat file grows the time it takes to search for things in that file will increase linearly. That is, if it takes 1 second to search for a record when the file has 1000 lines it will take 10 seconds to search for that same record when the file contains 10000 records. Using indexes, time will increase logarithmically with respect to the number of records. Best, Patrick Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-262860 Share on other sites More sharing options...
lalabored Posted May 28, 2007 Author Share Posted May 28, 2007 I see. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/53005-solved-using-flat-file-databases/#findComment-263470 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.