Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Databases _ Forum database stricture

Posted by: joyful Jun 9 2011, 01:44 PM

Hey!

Simply out of personal interest, I was wondering what then standard stricture of a forum database is...
For example, HTML help: Is each topic a new table? and each sub category (Like Programming etc,) a new database?
Or, is the whole forum one database?

Also, I am wondering this about a mySQL database forum (I am sure there other database types, but I am wondering about mySQL)

Thanks! smile.gif I was just wondering!

--

Posted by: joyful Jun 14 2011, 02:36 PM

Anyone?

I was simply thinking about and wondering what this sort of thing would be like...

What would the stricture of a large database of this kind be like?
Would each topic be a table?

Thanks a lot! smile.gif

Posted by: Darin McGrew Jun 14 2011, 05:53 PM

If I were designing a forum, I'd have the entire forum be a single database. I wouldn't create separate databases for each topic.

BTW, the word you're looking for is "structure" not "stricture". The word "stricture" means something else entirely.

Posted by: Brian Chandler Jun 15 2011, 02:18 AM

QUOTE(joyful @ Jun 15 2011, 04:36 AM) *

Anyone?

I was simply thinking about and wondering what this sort of thing would be like...

What would the stricture of a large database of this kind be like?
Would each topic be a table?



A table is a collection of entries, each having the same structure. And each *topic* has the same structure. It therefore makes no sense to have one table per topic. You need a table TOPIC, in which each entry contains all the bits of info relating to a single topic. But within a topic there will be many posts; you therefore need a table POST, in which each entry contains all the bits of info relating to a single post. Each entry in the POST table will include the id of the TOPIC to which it belongs.

(This is "database 101", I think...)

Posted by: joyful Jun 15 2011, 01:00 PM

Hey! Thanks for the replies.
Sorry about the misspelling (structure), my bad! wacko.gif

So, it would be made of 1 database that had 2 tables. (POST and TOPIC)
So, The TOPIC table would basically be a list of all the topics?
And the POST table would be all of the posts (they would be coordinated with the topic they are from in the TOPIC table)?

Do I understand correctly?

Thanks a lot! smile.gif

Posted by: Darin McGrew Jun 15 2011, 03:01 PM

That sounds like a reasonable approach to me. But you're likely to have more than just those 2 tables.

Posted by: joyful Jun 15 2011, 07:36 PM

What else would you have? Maybe "USERS"?

Anything else?

Thanks again! smile.gif

Posted by: Darin McGrew Jun 15 2011, 08:15 PM

Yes, USERS seems like a given, unless all the posts are anonymous. And if users can upload files, then you might need a table for those. And so on, depending on the functionality you're going to implement.

Posted by: joyful Jun 17 2011, 01:56 PM

Yes... That is true...

Thanks a lot Darin and Brian... That perfectly answers my question! blush.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)