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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:03:53+00:00 2026-05-16T23:03:53+00:00

For a rating system that is dependent on factors such as votes, how do

  • 0

For a rating system that is dependent on factors such as votes, how do they store the reputation? Eg. Stackoverflow.

  1. Do they calculate it everytime the page loads? eg. searching all posts and adding and multiplying?
  2. Store it in a reputation field on the user table and increment it everytime a vote is being casted?

Which is the most efficient way to implement something like this?

  • 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-16T23:03:53+00:00Added an answer on May 16, 2026 at 11:03 pm

    There is a way to figure this out for all cases, not just this one.

    First, you know your data and how it’s used better than anyone. You have to apply that knowledge in your designs. This is why almost every database question is correctly answered “depends”, just like this one.

    You’re trading time for other time.

    You can either spend time maintaining the calculated value with each change. Option 2.

    Or

    Calculate every time you need to return the value to a report/page/service call. Option 1.

    If you do LOTS of queries against the value, but it changes only so often… you really just want to cache that value. You would store the calculation rather than requery constantly.

    If it changes very quickly, but you report on it once a day… all the overhead it takes to maintain that value and the contention (read: scalability limiting) it introduces is more onerous than the once per day calculation.

    In the example, you have a well defined, finite set of actions which can affect a user’s rep. Each of those enumerated functions could easily call a function which takes a user_ID and quantity and update that column/attribute. Those actions happen more infrequently than the number is reported; and since reads exceed writes…

    What is important to you?
    It also depends on what is important to you.

    Let’s say in the case of SO, they would like to precalculate the number but the penalty for reporting a number that’s slightly incorrect is low. (Do you think Jon Skeet is sweating the +2 for a recent upvote?) But the updates are really slowing the website down… just for example. Since page load speed is what the business values above everything else, you may break the above guidelines.

    Again, only you can decide what is truth for your business.

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

Sidebar

Related Questions

I just created a star rating system that change image on mouse over., but
does anyone know how its possible to make a rating system that updates across
We implemented a rating system on a site a while back that involves a
I've built a rating system for movies in MySQL, however the concern is that
I am trying to write a star rating system in javascript that allows the
I guess you're familiar with the 5 stars rating system that's often used on
I'm working on a project that needs a ratings system where they can rate
I'm implementing a star-rating system on a product page. The current one is bloated
I have a rating system that uses the following equation to generate the rating
Every programmer here knows about ratings like that: Rating system http://img69.imageshack.us/img69/4241/98948761.gif The problem is

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.