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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:02:12+00:00 2026-05-18T20:02:12+00:00

I have an app where users get points for actions they perform – either

  • 0

I have an app where users get points for actions they perform – either 1 point for an easy action or 2 for a difficult one.
I wish to display to the user the total number of points he got in my app and the points obtained this week (since Monday at midnight).

I have a table that records all actions, along with their time and number of points.

I have two alternatives and I’m not sure which is better:

  1. Every time the user sees the report perform a query and sum the points the user got
  2. Add two fields to each user that records the number of points obtained so far (total and weekly). The weekly points value will be set to 0 every Monday at midnight.

The first option is easier, but I’m afraid that as I’ll get many users and actions queries will take a long time.

The second option bares the risk of inconsistency between the table of actions and the summary values.

I’m very interested in what you think is the best alternative here.

Thanks,
Dorian

  • 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-18T20:02:13+00:00Added an answer on May 18, 2026 at 8:02 pm

    Take option one. Scale later

    My thought is to take the simpler approach of querying the table each time and when you have the problem of so many users on your site that it’s slowing down your server, you can switch at that time. If you have so many users that your server is slowing down then probably you’ll need to scale other parts of your application too, but don’t go out of your way terribly at these early stages to scale your application. Scale when you need to scale.

    My point of view is taken from the 37signals book “Getting Real”, chapter 4 – Scale Later
    http://gettingreal.37signals.com/ch04_Scale_Later.php

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

Sidebar

Related Questions

No related questions found

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.