PHPackages                             redis/ranking - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. redis/ranking

ActiveLibrary[Caching](/categories/caching)

redis/ranking
=============

Wrapping Redis's sorted set APIs for specializing ranking operations.

1.3.2(3y ago)21190PHP-3.01PHPPHP &gt;=7,&gt;=8CI failing

Since Apr 28Pushed 2y ago3 watchersCompare

[ Source](https://github.com/matsubo/redis-ranking)[ Packagist](https://packagist.org/packages/redis/ranking)[ Docs](https://github.com/matsubo/redis-ranking)[ RSS](/packages/redis-ranking/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (5)Versions (9)Used By (0)

Ranking API for Redis
=====================

[](#ranking-api-for-redis)

[![Coverage Status](https://camo.githubusercontent.com/4d03c0459430f981d2272fb9e2be2c75c3e919d66751f901e7d05445d9f23d60/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d61747375626f2f72656469732d72616e6b696e672f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/matsubo/redis-ranking)[![Stable Version](https://camo.githubusercontent.com/1e1026362e2b7b0f2de44240c73c57afbe377fa7c0c87395d10de1482e6514a7/68747470733a2f2f706f7365722e707567782e6f72672f72656469732f72616e6b696e672f762f737461626c652e706e67)](https://packagist.org/packages/redis/ranking)[![Download Count](https://camo.githubusercontent.com/e4324c910c62883b2aff80136a8394a06086b657a8b74341887b77250c6b65ab/68747470733a2f2f706f7365722e707567782e6f72672f72656469732f72616e6b696e672f646f776e6c6f6164732e706e67)](https://packagist.org/packages/redis/ranking)

Requirements
------------

[](#requirements)

- Redis
    - `>=2.4`
- PhpRedis extension
    -
- PHP
    - `>=7,>=8`
- Composer

Installation
------------

[](#installation)

- Using composer

```
{
    "require": {
       "redis/ranking": "1.2.*"
    }
}

```

```
$ composer update redis/ranking --dev

```

Benchmark sample
----------------

[](#benchmark-sample)

```
% php sample/benchmark.php
Add: 18,350 queries/s
Update: 17,876 queries/s
Get score: 21,361 queries/s
Get rank: 22,123 queries/s
php sample/benchmark.php  1.50s user 2.96s system 43% cpu 10.203 total

```

How to run unit test
--------------------

[](#how-to-run-unit-test)

Run with default setting.

```
% vendor/bin/phpunit -c phpunit.xml.dist

```

Currently tested with PHP 7.4.5 + Redis 5.0.7.

TODO
----

[](#todo)

- Implement following APIs
    - `zRemRangeByRank`, zDeleteRangeByRank - Remove all members in a sorted set within the given indexes
    - `zRemRangeByScore`, zDeleteRangeByScore - Remove all members in a sorted set within the given scores
- Implement `zUnion` API as a static helper API.

History
-------

[](#history)

- 1.3.0
    - Updated libraries
    - Added PHP 8 Support and omit PHP 5 support.
- 1.2.0
    - Updated dev tools
- 1.1.0
    - Code Refactoring
    - Added PHP 7.0 support
    - Library update
    - Removed PHP5.3 and PHP5.4 compatibility
- 1.0.1
    - bugfix: correct variable name.
    - supports travis CI and passed test.
- 1.0.0
    - Published

License
-------

[](#license)

It is released under the [PHP License, version 3.01](http://www.php.net/license/3_01.txt).

Copyright
---------

[](#copyright)

- Yuki Matsukura
    -

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~686 days

Recently: every ~615 days

Total

6

Last Release

1371d ago

PHP version history (2 changes)1.1PHP &gt;=5.5.0

1.3.0PHP &gt;=7,&gt;=8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/98103?v=4)[Yuki Matsukura](/maintainers/matsubo)[@matsubo](https://github.com/matsubo)

---

Top Contributors

[![matsubo](https://avatars.githubusercontent.com/u/98103?v=4)](https://github.com/matsubo "matsubo (77 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

---

Tags

redisrealtimerankingsorted setSocial Game

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/redis-ranking/health.svg)

```
[![Health](https://phpackages.com/badges/redis-ranking/health.svg)](https://phpackages.com/packages/redis-ranking)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k318.6M2.7k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k40.4M72](/packages/snc-redis-bundle)[clue/redis-protocol

A streaming Redis protocol (RESP) parser and serializer written in pure PHP.

5214.4M13](/packages/clue-redis-protocol)[cache/redis-adapter

A PSR-6 cache implementation using Redis (PhpRedis). This implementation supports tags

534.0M27](/packages/cache-redis-adapter)[enqueue/redis

Message Queue Redis Transport

405.7M29](/packages/enqueue-redis)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23517.0k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
