1👍
You will appreciate the concept of sorted sets in Redis.
Don’t miss the paragraph which describes your problem 😀
2👍
I’ve written a number of leaderboards libraries that would help you out there. The one that would be of immediate use is python-leaderboard, which is based on the reference implementation leaderboard ruby gem. Using Redis sorted sets, your leaderboard will be ranked in real-time and there is a specific section on the leaderboard page with respect to performance metrics for inserting a large number of members in a leaderboard at once. You can expect to rank 1 million members in around 30 seconds if you’re pipelining writes.
If you’re worried about the data changing too often in real-time, you could operate Redis in a master-slave configuration and have the leaderboards pull data from the slave, which would only poll periodically from the master.
Hope this helps!
- [Django]-Django loaddata returns a permission denied for relation
- [Django]-Django-admin action in 1.1
- [Django]-Django rest framework viewset permission based on method
- [Django]-Django Invalid HTTP_HOST header: 'mydomain'. You may need to add u'mydomain' to ALLOWED_HOSTS
1👍
Make a table that stores user id and user score. Just pull the leader board using
ORDER BY user_score DESC
and join the Main table for the User name or whatever else you need.
Unless the total number of tests is a variable in your equation, the calculation from your ranking system should stay the same for each user so just update individual entries.
- [Django]-DeleteView with confirmation template and POST method
- [Django]-Using Requests python library to connect Django app failed on authentication
- [Django]-Change model admin form default value
- [Django]-Django group by with variable