Forum BigDB Ranking system - how to?

Discussion and help relating to the PlayerIO database solution, BigDB.

Ranking system - how to?

Postby Turrican » July 17th, 2012, 1:30 pm

OK... I read some threads about this.
What I read is that´s not possible to know the position of a player on the bigDB, right?
But a ranking system consists in the position! :)
I have a soccer game, all is working fine but I need a ranking system based on position of a player (depending on its score).
So, what can I do?
I don´t need new players playing against experienced players, so the position can shows how the player is good or not.
Ranking system based on position gives to the players the desire to play again and again and up its position on the ranking!
So, please!! Why bigDB don´t have an index number that can be sorted based on a key?
And if you won´t do that, what can I do?
How can I show the ranking position of a player? How can I calculate it?
Is there a full coded example?
Turrican
 
Posts: 23
Joined: August 11th, 2011, 11:50 pm

Re: Ranking system - how to?

Postby dreamora » July 17th, 2012, 1:47 pm

BigDB has indices that can do exactly that actually

But you can't find out number XX you are looking at when you have an object without jumping through small hoops because you can only request at maximum 1000 keys in LoadRange, so you will need to request 1000 -> if not in, request next 1000, ...

the reason is rather simple I guess: it can do its job many many times faster than a standard SQL database as it does not need to do the heavy lifting required to make it work on the db side.
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: Ranking system - how to?

Postby Turrican » July 17th, 2012, 1:56 pm

Hi dreamora, thanks.
So if I want to know a ranking of a player by its name, I need to read the db by Score (descending) by 1000 to 1000 until I found its name?
Turrican
 
Posts: 23
Joined: August 11th, 2011, 11:50 pm

Re: Ranking system - how to?

Postby dreamora » July 17th, 2012, 2:25 pm

You would first add an Index that sorts by score descending. But beside that yes you would read items after items to get there.
Just keep the traffic impact in mind of such massive requests.
If you would limit your game to the top X only then you could do it like that. But with a single continous one it wouldn't work.

A way to approach it is the nintendo way: have a db that has 'score ranges' and relative ratings in, take player scores and then see in what range they are and offer that and only have a real highscore list for the top 100 or so if at all


Keep in mind that traditional SQL would have the same problem, as it would require a count there too.
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: Ranking system - how to?

Postby Turrican » July 17th, 2012, 2:35 pm

OK, I´ll try to make it.
Thanks a lot!
Turrican
 
Posts: 23
Joined: August 11th, 2011, 11:50 pm


Return to BigDB