python开源报表系统_分享开源一个 Python 写的百万数据的排行系统

Leaf

Leaf is a Leaderboard system that helps you rank million user data.

项目已经完成基本功能,但还是有比较多bug。 项目是为了建立一个可复用抽象的排行系统模块。

现在支持分布式定时任务,mysql直排和三种有效的桶排。将来将会集成多数据库支持。

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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值