I am focusing on a server to have an video game that ought to have the ability to handle countless gamers. Now the overall game needs leaderboards and wishes to have the ability to show a gamers present position and perhaps other gamers close to the current gamers position along with the positions from the gamers buddies.

Now I have carried this out stuff before in MySQL and I understand how it's technically possible, however figured as this is a typical practice for a number of games there has to be existing libraries or databases particularly for this function?

Can anybody advice me what database is right for these kinds of queries and perhaps any pre-existing libraries that already perform a large amount of the work? A 3rd party service with API access could be fine too.

Aspire to find some good advice, thanks!

Edit:

To clarify, I want a database which could hold countless records (to date MySQL is nice for your) that I'm able to easily get rated results. For instance basically obtain a specific row in the "leaderboard" table I have to know which rank that row has. This question needs to be under 500ms no matter how big the db.

Alternatively a method to update the table using the current ranking information could be fine too lengthy because this update query doesn't lock the entire table and also the update query runs within thirty seconds.

Any ideas in regards to what database / mechanism or 3rd party plan to use could be much appreciated!