[erlang-questions] How would you do it?

Max Bourinov bourinov@REDACTED
Mon Jul 2 12:29:32 CEST 2012


Hi Erlangers,

I need to build a ranking system for online game.

I think I will have a ranking gen_server that will accept cast messages
like this: {score, Player :: profile(), Score :: integer()}.

So, the question is what would be most appropriate data structure if:

   1. I have to rank about 50 000 - 100 000 different players.
   2. On each score message I have to re-sort whole ranking table.
   3. It must be very cheap to get:
      1. top 100 players
      2. player's rating +/- 10 players about current player
   4. I expect about 20-50 score messages per seconds
   5. Size of score message is about 4KB (profile takes most of the space).


Any ideas or suggestions are welcome!

Best regards,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120702/2046bb16/attachment.htm>


More information about the erlang-questions mailing list