How to make global player ranking system?

Again, MemoryStores remove data after a certain TTL, so you’d need to re-insert the data after a certain TTL, depending on if that user is still online in the game if you’re using ProfileService (also, I recommend using the updated version, ProfileStore).

Additionally, even if you were to find a workaround like this, the memory limit of a MemoryStore is 64KB + 1KB * [number of users], which at absolute minimum, will be 65KB. It’s not a scalable solution if your game gains traction with many users playing. Backing up this point, if you look at the memory stores documentation, in the initial picture it even says is “Do you expect to have fewer than 1,000 keys?”, which suggests a sorted map shouldn’t be used for huge data sets (like 700,000 keys for example).

Unless anyone has any other ideas or if I’m missing something obvious, I would think the only way to implement a resilient, scalable implementation of this functionality is to create your own DB and API, link them together (personal preference is PostgreSQL with an Express API or something, there’s a bunch of frameworks and fancy magical options you can use) and call your API via Roblox, maybe every few minutes to get the up to date ranking for that player.

You could also use that same data source to make global leaderboards and all sorts.

That’s how I imagine many of the big games do this, even Obby Royale.

1 Like