https://github.com/ppy/osu-global-rank-lookup-cache
Caching layer for the most expensive of database operations
https://github.com/ppy/osu-global-rank-lookup-cache
Last synced: about 1 year ago
JSON representation
Caching layer for the most expensive of database operations
- Host: GitHub
- URL: https://github.com/ppy/osu-global-rank-lookup-cache
- Owner: ppy
- License: mit
- Created: 2020-09-19T11:58:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T09:54:17.000Z (over 1 year ago)
- Last Synced: 2025-04-06T04:26:12.698Z (about 1 year ago)
- Language: C#
- Size: 56.6 KB
- Stars: 12
- Watchers: 10
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# osu-global-rank-lookup-cache [](https://discord.gg/ppy)
A memory-based caching layer for beatmap-rank lookups which cannot be easily optimised as a database/SQL level.
Intended to handle queries which iterate over large sections of (already indexed) scores, where the overhead of counting rows becomes an issue.
# Query API
`/ranklookup?beatmapId={$beatmapId}&score={$score}&rulesetId={$mode}`
`$beatmapId` - The beatmap ID to lookup
`$score` - The achieved total score value
`$mode` - The ruleset ID (0..3)
# Response
An zero-index integer denoting the rank in the leaderboard for the provided score.
# TODO
- Currently this is only useful for global leaderboards. Mod filters cannot be applied, for instance.
- After an initial query, the queried beatmap will be tracked permanently. There is no cache expiry, so the potential of saturating available memory is real. LRU expiry should be implemented.
- More correctly handling top 50 lookups where score collisions are feasible (need to fallback to ID).