So this is more of a general question. Here is the deal.

So I made a web application which needs to know how many posts the user made for an award system. The more post the more rewards you get.

The problem is, I don't know what would be a better solution.

1. One solution is to store the number of posts in the database and just retrieve which is what I am leaning towards as it seems this would cause less # of accesses to the database.
2. The other option would be to count the number of posts dynamically which is easy enough to do. However this would mean that I would have to recalculate the data every time a page is refreshed. Of course, you could be smart about this and make it so it only counts when a new post has been added, but it would require more work.

Now I don't have a problem with either solution. In fact, I have implemented both solutions before, however I was wondering if someone could tell me which is better OR if they have another solution to this.