Leaf is a Leaderboard system that helps you rank million user data.
1.top排行需要及时真实（比如排行榜单前1k名）（可以使用内存数据加速，比如heap，red blcok tree）
In system, supporting two leaderboard ways, one is ranking by score DESC,the same score has the same rank; another is 'dense' that ranks by score DESC, entry id ASC, the same score has diffrent rank order by entry id ASC.
In leaderboard attribute 'adapter', has four values ('base', 'bucket', 'block', 'chunk'), they are four leaderboard algorithms, but the kernel algorithm is bucket sort algorithm.
.. note:: When you don't use base adapter to rank leaderboard, you shuld set cron to fresh the bucket table
Base MySQL SQL
When set leaderboard adapter to 'base', the system will use the MySQL SQL, realtime sort the entries.
It suits for small data leaderboard that less 10k data.
When set leaderboard adapter to 'bucket', it will summary user count by score to help rank your leaderboard.
When set leaderboard adapter to 'block', it will summary user's conunt by a static scoce grap, like score block [0-100], [101-200]…,
it can be used to rank the user score histgram is steady and smooth.
When set leaderboard adapter to 'chunk', unlike block algorithm using a static score grap, but is dynamic score grap that makes sure user's count between a suitable range like (5000, 10000]