How could I go about making a market where players can sell their items or buy items from other players who have put items up for sale, (also should work after they leave the game, I assume I’m going to have to use data stores).
I mean I don’t have experience with this specifically, but I would assume you should use datastores, just make sure each item has some sort of unique identifier that way nothing gets duplicated or deleted from a glitch.
The player datastore, that the unique identifiers of the items the player made
The market datastore, that has the actual items data. For that you need to use some sort of pagination due to the maximum key limit(4MB). Together with compression you should be able to make these pages really big like 1K items each, and for each page you use a different key(that can be the page number). The issue is that when a client tries to edit/upload an item, they should have the most updated version of the list. So you must add a feature in your system where two clients aren’t allowed to make a market upload/edit at once for the same page. So the bigger the number of items per page you chose, the less frequent said requests must be.
I haven’t found a datastore system for the second example, perhaps someone will make one some day. I find myself looking for “non-player related datastores” at times.