Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4085954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:39:24+00:00 2026-05-20T18:39:24+00:00

I am a beginner at database design and I would like to create a

  • 0

I am a beginner at database design and I would like to create a comment system with the ability to reply to user comments and to display potentially all comments a user has made. Furthermore, there will be many pages that will each have a section for commenting.

So far I have come up with two potential database designs to structure the comment system. The first will have a table for each pages’ comments and a table for each users’ comments. The page comment table will have user_id and page_id fields for table linking purposes.

The second potential design structure is to have one large partitioned table of comments that just has comment_id and user_id fields for table linking. I haven’t thought about how to approach the reply feature yet; I wanted to get some input on which design approach, if any, would perform efficiently before I tackled that problem.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:39:25+00:00Added an answer on May 20, 2026 at 6:39 pm

    I’d go with two tables: one for comment threads and another for the comments. The comment threads would look something like this:

    id
    /* Other bookkeeping things like created time and such */
    

    and comments:

    id
    thread_id
    user_id
    comment
    parent_id
    /* Other bookkeeping stuff */
    

    Then attach the thread to the page by adding a comment_thread_id column to the page table.

    Having a separate distinct comment thread gives you a convenient place to attach access control or similar extensions in the future, it also allows you to attach comment threads to things. Attaching the comment threads to the page rather than the other way around makes it easy to add comment threads to other objects in your system later on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite a beginner at database design. I have two problems that I'd like
I am beginner in Oracle database system. As I noticed, it is possible to
I'm really a beginner, I'm reading many different Android books as I would like
I am implementing a Database for my (beginner/Android) application. It is not clear to
i'm still a beginner, and guess it's a simple CakePHP question... all i want
What is the correct way to design this database? Here is how I have
Yii beginner here. I am facing some problem with how to query the database
I am just a beginner in php. I used the following code to display
I am a database beginner, I met a problem during my study. I am
Q: I'm a beginner to the XML.I have some data comes from my database,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.