Help with Massive Global Leaderboard

I want to create a massive global leaderboard (it would store like 10 million users), it wouldn’t be all display in Gui, I just need a way to get a player’s rank out of that leaderboard

I’ve looked into order data stores, but there is a certain amount of requests you can make out to them and I would need to load all that data which would simply take too longer with order data stores doing only 100 keys per request
I’ve tried Saving all the data into a table, then splitting them up into 4mb pieces to store in a datastore, but I can only save 200,000 users per key and I can’t think of an effective way to change the data in the tables, because if to players update the table at the same time only one of there new data will go through.
I also don’t want to offshore the data saving as my client doesn’t want to pay for the a server.

1 Like

If you offshore it would surely be fine running on almost anything, you could probably find something free to host it. I think that may be the easiest way.

1 Like

If that’s the only solution, how would I even go about doing that

You need a simple HTTP server with a database to store the leaderboard. There are a lot of options for doing that and most are going to be overkill since they’re typically for websites. If I were doing it I’d see if there was an Azure example for C# and modify that.

1 Like

For anyone who is curious I have managed to make this work with roblox api, sort of. Ultimately you want to be using an external database but rn this should do fine for a 2k ccu game. Basically you need a server system, that setups one primary server from the servers running your game. This primary server will be used for the actual processing of stuff from the leaderboard datastores. But why not just have every server sort through the datastores? Through put limits, you can only request a maximum of 4 mb per key every minute across all servers. From this primary server you can use message service to request specific range of data, it can’t exceed 1 kb as that is the maximin amount of data message service can send cross servers. Regarding actually saving a player’s data to this global leaderboard, when a user leaves your game, you want to add the user to a memory store which holds users needing updating. Then every minute your primary server will add the users needing updating to a dictionary which is then sorted using the table.sort function.

If you guys would like a community post for this get me to 25 likes, or if you just have any questions add me discord:coolbulldj

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.