I have a “points log” database table where I award points to users. Users can use their points to unlock certain functions in the app.
How do I accurately show the number of points each user has on their dashboard?
So far, I have thought of 2 ideas:
The first is to have a “points” column in the user database table. And then I will update this value every time they are awarded points / if they spend their points. The problem with this is that if something messes up somewhere, then this total points column becomes inaccurate permanently.
The second idea is for me to query the points log and sum up all the points that they have been awarded / spent. The problem with this method is that Xano has to go through the whole points log before summing everything up. Not sure if this will affect performance if I have to fetch / sum everything every time the page loads?
What’s the best way to do so?