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

  • SEARCH
  • Home
  • 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 6805953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:39:02+00:00 2026-05-26T19:39:02+00:00

I have a question about how to structure a DB. I have a reddit’esque

  • 0

I have a question about how to structure a DB. I have a reddit’esque voting system. Items can get votes. But each item belongs to a topic and each topic a category. While only items can get votes I’d like to be able to access the # of votes within a topic and within a category as well. Any suggestions on how to accomplish this?

I see 4 main ways of doing this:

  1. De-normalize the votes and store the votes inside an attribute in the item table, the topic table, and the category table. I would then need to update all 3 whenever a vote / downvote occurs.
  2. Create a separate ‘vote’ model. Votes belong to items, items to topics, and topics to categories. Then I can just query number of votes through the chain whenever I need to access anything.
  3. Just have items and votes. Items would have a category and topic attribute.. then I’d query for items within a topic and count the votes on them..
  4. Learn to use a NoSQL db system.

Extra info: I’m using Rails and I only really know MYSQL at the moment. Is this a time I should learn something like Mongo? Can this only really be accomplished with Hadoop? Can I accomplish this in MySQL. Thanks!

  • 1 1 Answer
  • 0 Views
  • 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-26T19:39:03+00:00Added an answer on May 26, 2026 at 7:39 pm

    Create a separate ‘vote’ model. Votes belong to items, items to
    topics, and topics to categories. Then I can just query number of
    votes through the chain whenever I need to access anything.

    That’s the most flexible way to do what you’re talking about.

    Learn to use a NoSQL db system.

    Not for your current project.

    Is this a time I should learn something like Mongo?

    No.

    Can this only really be accomplished with Hadoop?

    No. Any SQL database can do this. Whether any SQL database can manage whatever you’re planning is a different question. Different platforms scale differently.

    Can I accomplish this in MySQL.

    Yes, easily.

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

Sidebar

Related Questions

I have a question about this question . I posted a reply there but
I have a question about how to structure communication between a (new) Firefox extension
I have this question about umbraco structuring and I can't find the answer anywhere.
GAE recommends using JDO/JPA. But I have serious question about using OODB like them.
Hi I have a question about the ISA header structure of EDI X12 message:
I would like to restyle a ContextMenu , but I have a question about
I have in my homework some question about data structure: I have elements which
a question about class design. Currently I have the following structure: abstract Base Repository
I have a question about MySQL. I have this table structure: ID Name ------
I have question about NSView: Imagine a Custom View where the mouseDown, mouseDrag and

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.