Using multiple ordered datastores

Hey, and thanks for reading in advance.

I’m helping a buddy out with his lookalike of the classic Outbreak Survival game, and we’re attempting to create a leaderboard that shows the top 20 players sorted by the sum of three statistics, as shown here.

Issue being - ODS entries can only store a single, positive integer for each key, meaning we’d either have to do a feedback loop of using the same key in the ODS to retrieve their data from the normal store and display in the same order the ODS gave us (requiring about 20 async calls at runtime) or create three separate ODS for each statistic, requiring three ordered async calls at runtime, which are equally expensive. Either process is fairly mundane and requires careful ratelimit monitoring, so I’m curious to know if anyone has devised or knows of a better method to achieve the end result we’re after here.

Any help or advice is appreciated.

If it’s sorted by the sum, you can probably just store the sum in an ODS and their full data in a table in one regular Datastore.

1 Like

We can and currently do, but that brings us to the issue of sorting it to display on the physical board. We’d have to run one call per ‘player’ on the board, costing us about 20 GetAsync calls at runtime, which is almost certainly an overload.

It’s not that we can’t find a way that works, we just can’t find a way that’s fast and works.

Yeah, it’s not ideal. I guess you could have some kind of combined store that contains the top 20 players’ data, but that would be unscalable and hacky. Regardless, 20 calls once per server on startup isn’t the worst.

1 Like