Ordered Data Stores are good for high scores or for cases where you want the 100-200 most recent pieces of data (using GetSortedAsync). This is not an ideal fit for a ban list, since you might need to ban thousands of accounts over time, unless you want to be able to easily review the last 100 banned accounts (might be useful if you have moderators and want to review who they've banned).
Normally, for each person who is banned or given mod/admin powers, the easiest solution is to put a different value in a data store that is associated with their UserId. However, you explain that you want to be able to display a list, so this solution doesn't help with that.
If you're happy with just showing the last 100 bans, you could use an OrderedDataStore, use the UserId as the key, and the time they were banned (using os.time()) as the value - you wouldn't need to use a normal data store in this case, because you can still GetAsync whether someone has an entry in the entire data store. To unban someone, remove their key from the OrderedDataStore.
If GetSortedAsync won't work for you, you can instead use a single global key where you list all the users who are banned (you could also throw in admins in there in a sub-table). When the server starts up, it can load up this list and convert it to a dictionary for fast look-up. If you modify this list later on, you might consider using MessagingService to let the servers know that the key has changed. We should analyze how many players can fit in a single key: UserIds are currently not more than 10 digits in length, so based on how HttpService's JSONEncode works, we can estimate that each person in a list will take up 11 characters at most. There is room for about 262141 characters, so you can fit 23831 players in a single data store key. Although this is a lot, if you ever do reach this limit, you'll have to change your scripts to load multiple keys or to use a more efficient encoding.
2 comments
Why do you need it all in one datastore? http://xyproblem.info
Cause i want to show the adminlist as in a datastore and I don't know how to get all admins without them being in-game you know.