Hello,
I am trying to create a point system in my program similar to stack overflow i.e. when the user does some good deed (activity) his/her points are increased. I am wondering what is the best way to go about implementing this in terms of db schema + logic.
I can think of three options:
- Add an extra field called points in the users table, and everytime a user does something, add it to that field (but this will not be able to show an activity of sorts)
- Create a function which will run everytime the user does good deed and it calculates from scratch the value and updates the points field
- Calculate everytime using a function without any points field.
What is the best way to go about this? Thank you for your time.