ASP Free Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherASP Free Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 1st, 2006, 07:05 PM
baseballdude_'s Avatar
baseballdude_ baseballdude_ is offline
Expert Learner
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2005
Location: Wisconsin
Posts: 1,891 baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 22104 Folding Title: Starter FolderFolding Points: 22104 Folding Title: Starter Folder
Time spent in forums: 1 Week 5 Days 13 h 45 m 4 sec
Reputation Power: 70
Send a message via AIM to baseballdude_ Send a message via MSN to baseballdude_ Send a message via Yahoo to baseballdude_ Send a message via Google Talk to baseballdude_
Forums Database Structure

I've been thinking about creating basic forums attached with my website ever since I started it, and I think i'm finally going to start the project. I have a basic idea of how I want to set them up, but my main concern is the database structure.

I could have it create a seperate table for each sub-forum, or I could have one huge table with an ID column to fetch the posts from that table. Either would work...but what would you suggest?

Reply With Quote
  #2  
Old January 1st, 2006, 10:56 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
You should visit hotscripts.com or aspin.com and download a few of the existing forum apps, and look over the db structures used. Most are pretty similar.
Comments on this post
RadioactiveFrog agrees!
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old January 2nd, 2006, 06:54 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,744 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1Folding Points: 378383 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 42 m 45 sec
Reputation Power: 1914
I would go with more tables, less data in each. basic structure I would go with:
1. Users: ID, Name, ...
2. Forums: ID, Name, ... (more details like forum description)
3. Threads: ID, Name (title of thread), Forum, ... (no post data!)
4. Posts: ID, User, Thread, Contents, TimePosted, ...
  • all ID fields will be auto number and PK.
  • thread starter is the User who posted the first Post in this Thread. same for the
    thread time - the TimePosted of its first Post.
  • have minimal amount of varchar fields, use as much numeric fields as possible.
  • for permissions, look in the thread started by JMH in the Lounge, you can store
    lots of permissions using single number.
  • I would prefer to avoid storing all the posts in single table - it would make the
    table huge, slowing down search time. when storing post, check the size: if it's
    less than kilo byte, for example, store it in the table itself. otherwise, store it
    inside text file and put full path of the text file in the Posts table. The downside
    is you won't be able to search within posts - one solution is creating daily Index
    of some sort.
I believe most modern forums use at least part of the above logic, so you can
look in existing forums as Doug suggested instead of re-inventing the wheel.
Comments on this post
RadioactiveFrog agrees: Good advice - as always
baseballdude_ agrees: Thanks, almost exactly what I had in mind

Reply With Quote
  #4  
Old January 2nd, 2006, 08:04 AM
RadioactiveFrog's Avatar
RadioactiveFrog RadioactiveFrog is offline
Senior Glowing Wizard
ASP Free God 7th Plane (8000 - 8499 posts)
 
Join Date: May 2005
Location: Sussex
Posts: 8,223 RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)RadioactiveFrog User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1Folding Points: 160486 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 3 h 46 m 30 sec
Reputation Power: 326
Send a message via MSN to RadioactiveFrog
Facebook
As doug said i would download a couple of free ones that work well and see how their databases are structured. phpBB is free and i have somewhere the sql file of IPB before it was charged for if you want that it could help you. Just PM me if you want it.

RF

Reply With Quote
  #5  
Old January 3rd, 2006, 01:31 AM
baseballdude_'s Avatar
baseballdude_ baseballdude_ is offline
Expert Learner
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2005
Location: Wisconsin
Posts: 1,891 baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)baseballdude_ User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 22104 Folding Title: Starter FolderFolding Points: 22104 Folding Title: Starter Folder
Time spent in forums: 1 Week 5 Days 13 h 45 m 4 sec
Reputation Power: 70
Send a message via AIM to baseballdude_ Send a message via MSN to baseballdude_ Send a message via Yahoo to baseballdude_ Send a message via Google Talk to baseballdude_
Thanks for your inputs guys. It's all much appreciated.

I'm goin to bed (next post i make is 1500). Not much these days, but considering i only drop by to help people out whenever i have free time, that's good
Comments on this post
RadioactiveFrog agrees: Early congrats for the 1.5k
Shadow Wizard agrees: yep your help is appreciated!

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherASP Free Lounge > Forums Database Structure


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT