aceband Posted July 22, 2009 Share Posted July 22, 2009 Hey there, I'm going to have a shot at making a PHP forum but I've recently read about Database normalization and i have a few questions: 1) Should i apply it to my forum - what advantages will it provide? 2) I'm not 100% on the rules and wonder if for the for example a threads 'number of replies' should reside as a column within the table that stores the threads title/ID etc or should it be in it's own table such as "THREADS_THREAD_REPLIES". Or is this wrong/overkill or more likely me just over-thinking again Thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/167008-normalization-with-php-forums/ Share on other sites More sharing options...
kickstart Posted July 22, 2009 Share Posted July 22, 2009 Hi For normalisation you could argue that you do not have a column for the number of replies on a thread (just count them when required). However for efficiency you are best to sometimes ignore full normalisation (ie, not point calculating something thousands of times), in which case it would be best to keep it in the table of threads. However remember that this means an extra field to update (and an extra field to get out of step). All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/167008-normalization-with-php-forums/#findComment-880612 Share on other sites More sharing options...
aceband Posted July 22, 2009 Author Share Posted July 22, 2009 That extra field means that there is more chance or 'corrupting' the row by constantly updating the field right? So would it be safer to have a seperate table that just has thread_ID and NUMBER_OF_POSTS so that if updating the amount of posts messes up at least the THREAD details are still in tact? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/167008-normalization-with-php-forums/#findComment-880625 Share on other sites More sharing options...
kickstart Posted July 22, 2009 Share Posted July 22, 2009 Hi Chances of an update are pretty limited, but realistically I would not think having an extra column to be updated would make it more likely to have an error. Adding an extra table would just need an extra table to be updated. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/167008-normalization-with-php-forums/#findComment-880638 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.