PDA

View Full Version : Building a basic message board


Shecky
04-09-2004, 12:35 AM
Im trying to plan out a component for a web venture I'm undertaking where my site users would be able to create little community groups, (which would basically be a kind of cookie-cutter web page that they could customize to a certain degree,) hosted by me. One of the features I want to include in these 'groups' pages is a very simple message board.

Since I'm the sloppiest coder ever, and I've never designed a mysql system that was used by more than 100 people a day, needed any advanced commands, or needed to be indexed at all, I figured I'd make this exploratory posting.

Let me run this structure by you brainiacs to see if I'm getting off on the wrong foot.

table - group_names:
pkey_ai, group_name, group_founder, (+ a number of settings columns)

table - group_members:
pkey_ai, member_name, group_name, lastlog_ts, (+ buncha info rows)

table - group_threads:
pkey_ai, in_group, title_text, posted_by, post_date

table - group_posts:
pkey_ai, in_thread, title_text, inner_text, posted_by, post_date


There will probably be other rows or even tables i decide i need later... but this is kinda an outline. If I forgot something, point it out, but dont laugh to hard... aside from being typed right there the only other place i have it written down is on a denny's napkin, in crayon.

Is it reasonable to dump all forum posts into a single table, which would be selected by a unique thread id number? (Keeping in mind that this base would be the data source for maybe a few hundred light-to-mid traffic forums.) I understand that indexing the thread id number column and using only one select condition would speed this up significantly, but, should I be using a different method anyway? I can only hope that my site is popular enough to generate hundreds of thousands of rows in the posts table, but can my server handle it?

I'm using an AMD XP 2200 server w/ 1gb memory on redhat, but will probably be looking at an XP 3200 before I launch my site. I haven't got the bread for a real server-class processor :(

firepages
04-09-2004, 04:02 PM
Is it reasonable to dump all forum posts into a single table, which would be selected by a unique thread id number?

depends who you ask ;)

ask phorum and 1 table per forum is the answer , ask phpBB and 1 big mental table is the answer , some (like FUDforum) use flatfiles for post storage (though not in the inefficient UBB/Yabb PERL-style flatfiles).

I would say that 1 big table is the most common approach.

ALL have their advantages , I personally on a busy forum and if I were writing from scratch would go for the 1 table per forum , or a flatfile system like FUD .. (which still employs a database for threads , tracking and indexing etc)

<edit>note that tables with millions of rows are perfectly workable assuming indexed correctly with an efficient schema</edit>

<edit_again>Just noticed that I totally misread your question so the above is probably n/a</edit_again>