Search code examples
phpmysqldatabaseranking

User ranks: how to do it without SQL?


I am developing server-side part of an online game and one of the tasks is to compute user ranks. At the moment its done using RDBMS, but it updates each user row every time some player wins a game. It results in deadlocks now, when there are 20 players online on average.

I understand the tendency - when there would be 1000 players database solution won't work at all.

How to compute user ranks at real time at Apache/PHP server? It there smarter database solution?


Solution

  • You can put your ranks in another table, which you TRUNCATE each time. A similar question has already been asked (and answered) and can be found here: Best way to update user rankings without killing the server