Leaf:百万数据排行系统

项目地址:https://github.com/thomashuang/Leaf

功能分类:其他   技术分类:Flask

更新时间:2014-08-20 21:56:18

用户关注:5520 次

用户评价:0 次 我来点评↓

Leaf
Leaf is a Leaderboard system that helps you rank million user data.
 
项目是一个可复用抽象的排行系统模块。 组合web框架推荐,推荐可自由拓展数据库模块的。
 
现在支持分布式定时任务,mysql直排和三种有效的桶排。将来将会集成多数据库支持。
 
项目地址: https://github.com/thomashuang/Leaf
 
海量用户的排行榜设计理念:
 
1.top排行需要及时真实(比如排行榜单前1k名)(可以使用内存数据加速,比如heap,red blcok tree)
2. 其他使用近似排行
3. 及时清除过期数据
 
Design
 
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.
 
Score Bucket
 
When set leaderboard adapter to 'bucket', it will summary user count by score to help rank your leaderboard.
 
Block Bucket
 
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.
 
Chunk Bucket
 
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]

我是作者,想要修改项目内容?把修改内容发到联系邮箱(看最底部)

用户评价 (0)

     

称呼(*)

网站

邮箱

填写右边的单词 simple

Copyright© Python4cn(news, jobs) simple-is-better.com, 技术驱动:powered by web.py 空间主机:Webfaction

版权申明:文章转载已注明出处,如有疑问请来信咨询。本站为 python 语言推广公益网站,与 python 官方没有任何关系。

联系/投搞/留言: en.simple.is.better@gmail.com 向本站捐赠