Sorting all content in a DataStore by upload time

In Super Mario Maker 2, you can sort levels by new. This gives the new levels some of the exposure they need to hopefully take off. I was thinking, how can I do this in Roblox on a massive scale? I have a game that I want to make that would heavily rely on this feature, and I want to know if it was possible.

I came up with this:

  1. Player uploads content
  2. The content is stored in a DataStore
  3. ???

However, I can’t figure out how to obtain all the content at once. And how would I remove the old content? I don’t know how a DataStore would help me here. How do I sort the data quickly enough? If anyone can provide suggestions it would be really nice.

*Please note that I don’t want a whole script, I just want to know how something like this would work.

Well at first I would think to use an OrderedDataStore and a DataStore except the issue is you can only store positive numbers as the value (in the OrderedDataStore). You could try storing the upload date as the value and just keep the keys between the OrderedDataStore and DataStore consistent. You can then use the OrderedDataStore’s GetSortedAsync function to get the latest levels and use the key for those levels to get the actual level data from the DataStore.