Skip to content

Commit

Permalink
Add basic api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jan 25, 2021
1 parent 38ec086 commit 6a8358d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,24 @@


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).

0 comments on commit 6a8358d

Please sign in to comment.