I'm building web service with ranking function.
I don't have powerful servers: whole service would be hosted in standard PC. There could be time, when many users (in this case many = ~100) are refreshing ranking, so I would do it way, in which users wouldn't crash server because of this.
There is no problem in no real-time refreshing: I can show user ranking generated some time before.
There is no problem for me in generating ranking. I can easily do this:
User.objects.filter(...).order_by('rank')
EDIT: More details: I have some workers doing some calculating. When worker ends its work, it changes rank field of some User instance. You can assume, all users would do actions leading to several (5-20) calculating, each causing rank change of this user.
If updating the ranking is too long a task to do per-request, then here are a few solutions you could be using:
Solution 1 is better performance wise but harder to get right. Solution 2 is easier to do, but could less optimal.