You wouldn’t store everyone’s best time in that key, just the 5 best ones. How often is a global record set? Your game has been running for a while – I would imagine a new record gets set once in a blue moon.
You could store each player’s best time in a key separate from the global records key.
Records are broken all the time and it shows top 20 or so for each of the 14 maps.
Each player has 1 table of 14 map names & corresponding times. (So it loads their own best time in case they’re not on the global leaderboard for them to see)
Each map has 1 best-times table each, which uses getsortedasync to get the times, outlined in the OP.
Roblox’s arbitrary limits with getsortedasync just didn’t take into account a racing game with multiple maps.
So you’re suggesting I switch from using getsortedasync (orders a list of loose keys in one go), to this?:
On server start:
14 GetAsync requests, each getting a table of best times for each map.
After someone finishes a race: [no change from the way it’s done now]
1 UpdateAsync, gets table, checks mapname in table if its personal best time should be updated, returns table if it is.
If someone beats a cached time in the server:
1 UpdateAsync, gets table, update+return if they’re already on there, or delete slowest+insert this person, returns table.
Tryin to work the math out here. Looks like it might work out o: