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 8300291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:30:49+00:00 2026-06-08T16:30:49+00:00

I am working on a voting system for my company, in this system, each

  • 0

I am working on a voting system for my company, in this system, each user can vote in one or more topics. Voting in a topic will cause this topic to get +1 in reputation while all other topics will lose -1 in reputation. (These numbers are rather arbitrary, the real values are a complex formula).

I was thinking to structure my database creating a view where I will store the ID for each topics, the total of votes for this topic, the total of votes for other topics, and the calculated reputation.

My problem is regarding performance/scalability. I think this solution is not very effective, because if I have 100 topics and 2 votes per second, I will have to refresh all the values for all the topics two times a second, that would be a total of 200 records per second.

Is this analysis correct? Is mssql engine going to handle it easily? Or should I look for some other approach? What do you suggest?

thanks,
Oscar

  • 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-06-08T16:30:53+00:00Added an answer on June 8, 2026 at 4:30 pm

    This is going to be very hard on the database.

    What variables does your formula depend on? If the amounts you’re adding and subtracting are somewhat global, you can keep track of them and only calculate the score of each topic when you need to display it.

    For example, you could increment the score of one topic only, but also increment a global variable that keeps track of how many “upvotes” there are in total. that way when you want to display the score of any topic, you would be able to calculate it on the fly without bombarding your database.

    More information about the formula can get you better advice.

    EDIT:

    You have this formula:

    origninalRep + (upvotes*10 - otherVotes) 
    

    You can get originalRep straightforward with one query.

    Same for upvotes.

    The “tricky” part would be otherVotes. But that’s simply globalVotesCount - upvotes, and you have those if you keep track of the global upvotes count.

    I hope this helps.

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

Sidebar

Related Questions

I have a jquery/php voting system I'm working on. Once a user clicks a
I'm implementing a voting system like the one used by stackoverflow. It's working with
I'm working on a simple suggestion voting system where users can +1 or -1
i have this jquery voting script, everything is working fine, it just that the
I am working on a comment voting system. I have a page profile_new.php?id=194 That
I'm working on a up, down voting script. When the user for example hovers
Working with an API that can handle multiple connections (i.e. sessions), each of these
I'm working on a simple voting system, using php and sqlite. I prebuild a
I'm working on a project that will use a comparison voting logic to sort
Working with an undisclosed API, I found a function that can set the number

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.