Ask HN: Is there a datastructure for leaderboards with filtering and timeslices?
I built a variation of B+Tree to track leaderboard rankings and it works similar to Redis Z functions (zadd/zrange).
Now I'm trying to think of a solution to filter by country code or some other player attribute. In addition, I also want to dynamically create timeslices so I can show leaderboard rankings that occurred between time A and time B.
If I were to implement the filter or timeslices into my B+Tree, I'd have to basically scan from the first record down to the last by checking against player attributes and/or the timestamp of when ranking was inserted.
The goal is to have 1 leaderboard index per stat, rather than X leaderboard per stat.
Is it feasible, or should I just create a new leaderboard index for every combination of attribute / timeslice?
3 comments
[ 2.7 ms ] story [ 16.1 ms ] threadMaybe I'm misunderstanding something, but if it's just a few thousand/tens of thousands of entries, it seems like the kind of thing any SQL can do pretty effortlessly...?
I am slowly working on a gaming portal platform, and I need to be able to host endless amounts of statistic leaderboards which can be individually cut many different ways. I'm researching if its even possible to be a bit more efficient and optimized to make a leaderboard focused database.