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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:30:36+00:00 2026-05-17T00:30:36+00:00

Practicing web development by making a social network. Users can earn points for performing

  • 0

Practicing web development by making a social network. Users can earn points for performing certain activities, so I have a PointHistory table for each User where point transactions are stored. To calculate the point balance, it makes more sense to have a dedicated PointBalance table that gets updated every time there is a change in a user’s point balance, right?

Example scenario: userA earns 10 points
-userA’s PointHistory table is updated, transaction1 is recorded as +10
-userA’s PointBalance table is updated to add 10 to the pointTotal

The alternative would be to have an algorithm that runs through the PointHistory table and calculates the point balance every time a point transaction occurs.

The dedicated table sounds like it would take fewer resources- or am I missing something?

  • 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-17T00:30:37+00:00Added an answer on May 17, 2026 at 12:30 am

    Normally, if the information can be derived from existing persisted data, it is better to recalculate than to save calculation results. This way, the recalculated data will always reflect persisted data and be accurate if the calculation changes.

    Of course, if there is a performance issue with this calculation, you may want to consider storing the result. However, you need to remember to updated this whenever any field it depends on changes, or if the calculation itself changes.

    It is difficult to say which scenario will be easier on resources (you only mention memory, though CPU, IO and Network usage all also come into play) – you should go with one solution with the idea of measuring as you go along and changing things if needed. Make sure your code is supple enough to adapt to such a change.

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

Sidebar

Related Questions

I am practicing making a web app which tries to read the user's twitter
I am practicing delegate in iphone development but have a problem 2012-05-12 21:21:54.279 DelegatePractice[2924:f803]
I'm practicing my Rails development skills by building an app that will have different
I've been practicing with asp.net web forms and controls and have now become a
Started practicing with XML and C# and I have an error message of There
While practicing the jxl API, i cant extract details from certain Excel sheet its
I have been practicing TDD and (some) XP for a few years now and
I have been practicing TDD in C# for several years now and recently have
I'm practicing on Django and using some online tutorial to build a web blog.
I am new to Java Web Application. I am practicing with JSF2. Is it

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.