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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:10:02+00:00 2026-06-05T10:10:02+00:00

I have a website where users submit posts that can be upvoted or downvoted.

  • 0

I have a website where users submit posts that can be upvoted or downvoted.

At the moment a user’s total earned points from all of his posts is not saved.

What is the best/common way to do this? How does a site like Reddit or StackOverflow do it?

Should I be adding and subtracting from the total user points every time someone votes on a post.

  • 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-05T10:10:03+00:00Added an answer on June 5, 2026 at 10:10 am

    You could cache the result of the sum of votes per user over all posts, and invalidate the cache for each user when the user earns a new vote, or you could store the total count in the database and make sure that any upvote or downvote runs as a transaction that also updates the total.

    Whether you do this using cache, or in MySQL using an extra table (I don’t suggest putting it in your users table) depends on how big your site is and what you want to do with the votes.

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

Sidebar

Related Questions

I have website where users can login with their Facebook account. I am using
I have a website which checks users IP and if its from CA displays
I have a Django website that requires users to be logged in to view
I have a website form that collects url of users to store in a
I have a website that prompt the users to enter serial number for a
I have a website for dance academy where Users can register and add/drop dance
I have multiple themes on my website and users can just switch between multiple
I have a website that uses OpenID to sign in users. The library I'm
We currently have a website that has user account functionality, but we are looking
Say you have a website for users to search for hotel rooms for rent.

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.